Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working to make the CLI support sqlite, and allow to create migration with sqlite #51

Open
lefuturiste opened this issue Jun 3, 2024 · 4 comments

Comments

@lefuturiste
Copy link

lefuturiste commented Jun 3, 2024

Hi,

I'm currently working to integrate sqlite into the ormlite CLI.

@lefuturiste
Copy link
Author

lefuturiste commented Jun 3, 2024

So it will require to also add sqlite support to kurtbuilds/sqlmo

@kurtbuilds
Copy link
Owner

That's awesome! PRs definitely welcome for both.

@lefuturiste
Copy link
Author

I'm a relative beginner to complex typing, trait, lifetime in rust so it's difficult for me to navigate the shear mass of code.
I tried to go full in and try adding feature "sqlite" but it's too difficult for now.
For now the best bet for me is to begin by duplicating the cli crate into cli_sqlite to workout what's needed and have a prototype.

@lefuturiste
Copy link
Author

lefuturiste commented Jun 3, 2024

The main problem is to make the argument "conn" that represent "Connection" configurable to be either PgConnection or SqliteConnection.

  • There is no function argument generics in rust
  • I did not find a way to change the PgConnection types to impl Executor, idk how to that, if you have a example it would be great.
    So there is two approach that I see:
  • have a way with impl Executor
  • have total code duplication with sqlite and pg
  • try to use macro rules to generate two bundle of code for each one postgres and sqlite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants