Comments (8)
I've written https://pub.dev/packages/sqlparser, which is a pure-Dart sql parser and static analyzer. Originally, it was written for another project, but it might be helpful to this library as well. It can turn any sql query into an AST (so you know whether it is an insert/update/select/etc.), so you could just do
final engine = SqlEngine();
print(engine.parse('SELECT * FROM tbl').rootNode is SelectStatement) // true
If you know the table structure at build-time, you can also register available tables to the sql engine by adding them to SqlEngine.knownTables
. Then, SqlEngine.analyze
can be used to figure out what's returned by queries and it can resolve the type of variables in the query.
from floor.
This looks awesome and seems to be the right fit for the library's needs. Thanks @simolus3!
from floor.
Many thanks to @simolus3 for the SQL parser, it saved a lot of time to solve this issue.
PR #733
from floor.
The Query needs to return simple data. (int, String, double, bool)
from floor.
Parsing SQL queries seems more tricky than expected. Unluckily I didn't find a package that could help with that.
from floor.
You might be interested in https://github.com/AlecStrong/sqlite-psi
Itβs the backend for https://github.com/square/sqldelight
from floor.
@cw-dev thanks, I'll take a look at it!
from floor.
As now is any way to do partial updates? With UPDATE queries or like Room's 2.2 partial updates.
from floor.
Related Issues (20)
- Improve FTS documentation and add some examples
- Not supported on Flutter Web HOT 1
- dependecy conflict with riverpod_lint 2.3.3 HOT 2
- Dumplicate field name when entity implement form abstract class HOT 1
- duplicate field name when entity implement form abstract class
- Unhandled Exception: type 'Null' is not a subtype of type 'double' in type cast HOT 1
- This exception cannot be executed on the entire floor library
- trying to get a SUM of a field with floor. HOT 1
- Custom Database File Path HOT 1
- sqlite wal HOT 1
- How to update a List of an object as field of entity into table in Floor
- How add rawQuery added ?? HOT 2
- Are there any plans to adapt HarmonyOS HOT 4
- Imports collision HOT 1
- #802 still an issue. any help?
- Casting to double might not work; HOT 1
- dependencies issue HOT 5
- Invalid query (failing to parse) does not throw an error
- onCreate callback is not being called, "tbl not found" exception
- How to select with like ??? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from floor.