GithubHelp home page GithubHelp logo

Comments (5)

windrunner414 avatar windrunner414 commented on July 21, 2024

It can prevent SQL injection

from floor.

windrunner414 avatar windrunner414 commented on July 21, 2024

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.

vitusortner avatar vitusortner commented on July 21, 2024

Thanks for your report! Using sqflite's parameter binding functionality seems to be a better fit, as you already suggested.

from floor.

windrunner414 avatar windrunner414 commented on July 21, 2024

waiting for fix it, now i manually modify generated sql.Thanks for your work

from floor.

vitusortner avatar vitusortner commented on July 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.