Code Monkey home page Code Monkey logo

Comments (7)

crookse avatar crookse commented on June 19, 2024 1

We could just change special characters to entities before they go into the database and then convert them back when we retrieve them

from deno-drash-realworld-example-app.

ebebbington avatar ebebbington commented on June 19, 2024

Do you have an idea of how this would be implemented? I'm used to using PDO or having the framework used do this, but not manually

from deno-drash-realworld-example-app.

ebebbington avatar ebebbington commented on June 19, 2024

Course nice, one, i was thinking of the whole query which is where i was going wrong

So i guess the end result would be:

  • All CRUD methods would call a new escapeQueryData method (or whatever name is best) before calling this.prepare
  • SELECT method would call a unescapeDBResult (or whatever name is best) to unescape the data at the end of the method, before returning it

from deno-drash-realworld-example-app.

ebebbington avatar ebebbington commented on June 19, 2024

Asked in pgc4d and deno-postgres to see if they currently have sanitisation implemented, or any plans to. Mainly because it would save us a job of doing it manually.

Note that there is another postgres module mentioned but by no means am i suggestion it, just trying to get as much info as possible

from deno-drash-realworld-example-app.

ebebbington avatar ebebbington commented on June 19, 2024

Author of pgc4d replied here, and they do encode queries when used with placeholders

from deno-drash-realworld-example-app.

ebebbington avatar ebebbington commented on June 19, 2024

Seems like deno-postgres does: await client.query("SELECT * FROM ids WHERE id < $1;", 2). Worth checking as hadn't had any confirmation from the owner

from deno-drash-realworld-example-app.

ebebbington avatar ebebbington commented on June 19, 2024

Postgress currently doesn't, but they do parameterise queries so it means we can strip out logic we have added to do that

from deno-drash-realworld-example-app.

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.