prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
583 stars 61 forks source link

Add API for in-memory SQLite #198

Closed tomhoule closed 3 years ago

tomhoule commented 3 years ago

There is intentionally no way to express in-memory databases as URLs. This would need to be discussed and thought through first.

tomhoule commented 3 years ago

TODO: docs for Sqlite::new_in_memory() and single::Quaint::new_in_memory().

pimeys commented 3 years ago

Few tests fail on Windows. You could maybe fix them with your changes here?

test src\lib.rs - (line 32) ... FAILED
test src\lib.rs - (line 51) ... FAILED

failures:

---- src\lib.rs - (line 32) stdout ----
Test executable failed (exit code 1).

stderr:
Error: Error { kind: QueryError(SqliteFailure(Error { code: CannotOpen, extended_code: 14 }, Some("unable to open database file: ///tmp/example.db"))), original_code: Some("14"), original_message: Some("unable to open database file: ///tmp/example.db") }

---- src\lib.rs - (line 51) stdout ----
Test executable failed (exit code 1).

stderr:
Error: Error { kind: QueryError(SqliteFailure(Error { code: CannotOpen, extended_code: 14 }, Some("unable to open database file: ///tmp/example.db"))), original_code: Some("14"), original_message: Some("unable to open database file: ///tmp/example.db") }

failures:
    src\lib.rs - (line 32)
    src\lib.rs - (line 51)

test result: FAILED. 78 passed; 2 failed; 1 ignored; 0 measured; 0 filtered out
tomhoule commented 3 years ago

Hmm, so these paths would need to be valid on windows. We can probably get valid windows paths from tempfile.