Comments (5)
It can prevent SQL injection
from floor.
It seems have a bug now.
@Query('select * from Books where bookName = ":bookName"')
Future<Book> findByName(String bookName);
it will throw a error Parameters of method signature don't match with parameters in the query.
if write
@Query('select * from Books where bookName = :bookName')
it can generate successfully but the generated sql is:
select * from Books where bookName = $bookName
bookName is a String! but this sql does not have quote, it will get a sql compile error
parameter binding is the best solution.Don't need quote and no sql injection
from floor.
Thanks for your report! Using sqflite's parameter binding functionality seems to be a better fit, as you already suggested.
from floor.
waiting for fix it, now i manually modify generated sql.Thanks for your work
from floor.
I've changed the implementation to use the mentioned argument binding functionality of sqflite, which will go into the next release.
from floor.
Related Issues (20)
- 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
- type missmatch int <-> double
- Primary id does not work
- No stream updates with quoted table name
- Feature Request: Add clearAllTables Function
- Feature request: Indexes on Expressions
- How can I initialize the database once? Singleton pattern
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.