Replies: 2 comments 2 replies
-
Hey @epipheus, I agree we can add support for create, drop and truncate database statement in SeaQuery. However, not that SQLite itself is a file (database) thus doesn't support those SQL database statement, we might need to throw panic for that. Just like what you have said, the only way to create database is to go raw SQL. For example, https://github.com/SeaQL/sea-orm/blob/207e2df48470c2506272d83f2f91a884a553350c/tests/common/setup/mod.rs#L11-L53 |
Beta Was this translation helpful? Give feedback.
-
I believe Sqlite will create a database if it does not exist, based on the path given (or the "connection string"). Just had a case where I used |
Beta Was this translation helpful? Give feedback.
-
I see that we are able to programmatically perform migrations. For testing in particular we need to be able to ensure test isolation and one way of doing that involves creating a fresh database as on the fly for testing especially because Rust runs tests in parallel. Given an ORM is a DSL abstraction from raw SQL it always feels wrong/dirty to me to use any SQL, I'd prefer to do it all via ORM api, but I don't see a way to to this. Like, I want to just create a database as a uuid name, perfom the test, nuke the db. Where is create db call?
Beta Was this translation helpful? Give feedback.
All reactions