You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🙏 This is a sweet looking library. I wanted to use Tantivy is WASM but it's a pain, so I'm hoping I can get this working in WASM.
The in-memory example in the README doesn't work and I think it's because query parsing is broken for SELECT *. Changing SELECT * to SELECT users.name works fine.
use reefdb::InMemoryReefDB;fnmain(){test_readme_in_memory_example();test_readme_in_memory_example_FIXED();// test_inner_join();// test_fts_text_search();}// It seems that `SELECT *` isn't working. The _FIXED version of the function// below does `SELECT users.name` and that works.fntest_readme_in_memory_example(){letmut db = InMemoryReefDB::new();let queries = vec!["CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)","INSERT INTO users VALUES (1, 'Alice')","INSERT INTO users VALUES (2, 'Bob')","SELECT * FROM users WHERE id = 1",];for query in queries {let result = db.query(query);println!("Result: {:?}", result);}}fntest_readme_in_memory_example_FIXED(){letmut db = InMemoryReefDB::new();let queries = vec!["CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)","INSERT INTO users VALUES (1, 'Alice')","INSERT INTO users VALUES (2, 'Bob')","SELECT users.name FROM users WHERE id = 1",];for query in queries {let result = db.query(query);println!("Result: {:?}", result);}}
Output:
Result: Ok(CreateTable)
Result: Ok(Insert(1))
Result: Ok(Insert(1))
Failed to parse statement: Parsing Error: Error { input: "SELECT * FROM users WHERE id = 1", code: Tag }
Result: Err(Other("Parsing Error: Error { input: \"SELECT * FROM users WHERE id = 1\", code: Tag }"))
Result: Ok(CreateTable)
Result: Ok(Insert(1))
Result: Ok(Insert(1))
Result: Ok(Select([(0, [Text("Alice")])]))
The text was updated successfully, but these errors were encountered:
Ah sorry looks I messed up the README. Yeah, it only supports select columns for now. As for wasm, I don't know if it would work out of the box, the in-memory one maybe but for the persisting one, I think you'll need to implement your own trait because of std::File not being wasm compatible, and serialize/deserialize from/to localstorage. Please share your findings if you manage to get it working with wasm
🙏 This is a sweet looking library. I wanted to use Tantivy is WASM but it's a pain, so I'm hoping I can get this working in WASM.
The in-memory example in the README doesn't work and I think it's because query parsing is broken for
SELECT *
. ChangingSELECT *
toSELECT users.name
works fine.Output:
The text was updated successfully, but these errors were encountered: