Replies: 3 comments 6 replies
-
I like this idea of using it to mock But the idea of supporting multiple SQL Dialects and a subset of the features so it can used as a mock databases during test is interesting. I am all for it. I think we can at least start with something like https://github.com/ballista-compute/sqlparser-rs, which is even already being used on the project. The library does a good job in dealing with different dialect, as you can see here in their docs. https://docs.rs/sqlparser/0.8.0/sqlparser/dialect/index.html. This lib has good support and it is almost hitting release 1.0.0. What do you think? |
Beta Was this translation helpful? Give feedback.
-
Ah yes, now I understand. Anyway, a more linear and less complex is not a bad idea. Any idea on how to approach this? Or idea on how it could look like. |
Beta Was this translation helpful? Give feedback.
-
Yes I have some thoughts, basically something like an IR. For example SELECT A.a, B.b from A LEFT JOIN B ON A.i = B.i WHERE A.a = 'a' and B.b = 'b' Would be TABLE_SOURCE A
TABLE_SOURCE B
JOIN_ON A.i = B.i
FILTER A.a = 'a'
FILTER B.b = 'b'
OUTPUT A.a
OUTPUT B.b Though the exact semantics would depends on the design of the execution engine. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
One of the use case for an embedded database is to mock a 'bigger' database like MySQL or Postgres.
Shall we support multiple SQL dialects?
If so, we need to design an AST that is able to support different dialects.
Then, we'd translate from the sqlparser AST to our AST.
But SQL dialect support on the frontend does not necessarily means that we'd support the full feature set of a database engine. It's just better compatibility for simple things that happens to be different but in theory trivial to implement.
Beta Was this translation helpful? Give feedback.
All reactions