docs: initial readme
This commit is contained in:
parent
912d00f2d3
commit
fa48c7a2b4
2 changed files with 41 additions and 2 deletions
31
README.md
Normal file
31
README.md
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# [WIP] sqlxgentools
|
||||||
|
|
||||||
|
Tools to generate SQL migrations and Rust SQLx repositories code from models structs in a SQLite context.
|
||||||
|
|
||||||
|
Will be used in [minauthator](https://forge.lefuturiste.fr/mbess/minauthator).
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Generate initial CREATE TABLE sqlite migration
|
||||||
|
|
||||||
|
cargo run --bin sqlx-generator -- ./path/to/project generate-create-migrations > migrations/all.sql
|
||||||
|
|
||||||
|
### Generate repositories code
|
||||||
|
|
||||||
|
not implemented yet
|
||||||
|
|
||||||
|
cargo run --bin sqlx-generator -- ./path/to/project generate-repositories
|
||||||
12
TODO.md
12
TODO.md
|
|
@ -7,5 +7,13 @@
|
||||||
- support foreign key CHECK constraints
|
- support foreign key CHECK constraints
|
||||||
|
|
||||||
- Repositories generation
|
- Repositories generation
|
||||||
- Create get_all
|
- default CRUD boilerplate
|
||||||
- Create get_by_id
|
- get_all
|
||||||
|
- get_by_id
|
||||||
|
- insert
|
||||||
|
- update
|
||||||
|
- custom queries
|
||||||
|
|
||||||
|
- Config file for project
|
||||||
|
- configure models path
|
||||||
|
- configure repositories path
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue