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

SQL logging during seeding #1011

Closed
jondot opened this issue Nov 24, 2024 Discussed in #959 · 4 comments
Closed

SQL logging during seeding #1011

jondot opened this issue Nov 24, 2024 Discussed in #959 · 4 comments
Milestone

Comments

@jondot
Copy link
Contributor

jondot commented Nov 24, 2024

Discussed in #959

Originally posted by felipesere November 3, 2024
Not sure if I'm holding it wrong 🤷‍♂️

I'm trying to move my PostsgreSQL backed app to use Sqlite (for "reasons") and my current hurdle is that I get the following error when seeding the users:

called `Result::unwrap()` on an `Err` value: DB(Json("premature end of input"))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is there a way to turn on SQL logging for seeding? I have it turned on in my test config but I see nothing.
It's hard to tell which column gives me grief :)

@jondot jondot added this to the 0.13.1 milestone Nov 24, 2024
@felipesere
Copy link
Contributor

I’m on my phone so can’t check this. But given that migrations are a separate crate with its own Cargo.toml, il pretty sure we would have to turn on the logging feature in the SeaORM dependency there…

I haven’t checked if it can be turned on at the crate level and then turned back off at runtime to be able to control it from the loco config.

@jondot
Copy link
Contributor Author

jondot commented Nov 24, 2024

no worries, i'll take a look as well

@jondot
Copy link
Contributor Author

jondot commented Nov 24, 2024

I did some checking, looks like logging and its flag wiring is good. Migration crate will get an already-initialized connection from the main Loco set up, so it will share what ever configuration were given initially.

I'm wondering if configuration on your end is really in sync with what you're running. For example, if you're running tests and expect to see these logs - your test.yaml might contain different flags, and also test.yaml has different log levels. I'd start with development.yaml for this.

The error itself follows from Sqlite requiring a Z to parse properly, indeed.

@jondot jondot modified the milestones: 0.13.1, 0.14.0 Nov 25, 2024
@jondot
Copy link
Contributor Author

jondot commented Dec 12, 2024

closing for now, please reopen if needed

@jondot jondot closed this as completed Dec 12, 2024
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