Tools to generate SQL migrations and Rust SQLx repositories code from models structs.
Find a file
2026-01-13 21:51:31 +01:00
docs docs: still WIP 2026-01-13 21:41:03 +01:00
lib refactor: apply clippy rules 2026-01-13 21:20:50 +01:00
.gitignore initial commit 2024-12-27 23:00:38 +01:00
.rgignore initial commit 2024-12-27 23:00:38 +01:00
Cargo.lock build(deps): upgrade some packages 2026-01-13 21:48:53 +01:00
Cargo.toml build(deps): bump sqlxgentools to 0.2.0 2026-01-13 21:51:31 +01:00
DRAFT.md feat: one-to-many relation helper 2026-01-11 16:28:07 +01:00
LICENSE-APACHE build: workspace packages metadata and license 2026-01-11 16:28:06 +01:00
LICENSE-MIT build: workspace packages metadata and license 2026-01-11 16:28:06 +01:00
README.md docs: still WIP 2026-01-13 21:41:03 +01:00
TODO.md feat(repositories): add methods get_many_of_related_entity and delete_many_by_id 2026-01-13 20:45:37 +01:00

[WIP] sqlxgentools

Little tool to generate SQLite migrations files and Rust SQLx repositories code, all from models structs.

Still very much work in progress, but it can be already used in your next Rust app if you don't mind some limitations like the lack of incremental migrations and little quirks here and there.

Getting started

Project context

Goals

  • Help developers that dont use ORM and use SQLx in a Rust project with a SQLite DB.
  • Auto generate boilerplate repositories pattern code
  • Auto generate CREATE TABLE base migrations from model struct
  • Auto generate Up and Down migrations
  • Let developer have flexibility over the model definition

Non-goals

  • Provide a full a ORM interface

Included crates

This project is split into 3 published crates.

Features

  • generate migrations
    • from scratch
    • incremental migration
    • up migration
    • down migration
  • generate repositories
    • get_all
    • get_by_id
    • insert
    • insert_many
    • custom get_by, get_many_by
    • get_many_of (from one-to-many relations)

Contributions

Questions, remarks and contributions is very much welcomed.