Git Product home page Git Product logo

Comments (3)

lmangani avatar lmangani commented on June 2, 2024 1

Thanks for the report @grahamhoyes
Feel free to submit a PR with any desired changes to achieve compatibility with your target.

from homer-app.

github-actions avatar github-actions commented on June 2, 2024

Your report is appreciated. Please star this repository to motivate its developers! ⭐

from homer-app.

grahamhoyes avatar grahamhoyes commented on June 2, 2024

Some details on a possible fix, I am not familiar with go or gorm so there may be inaccuracies:

  • I've only seen parameter binding with ?, %s, :name, etc work for values, not identifiers. That seems to be backed up by this stackoverflow post. So binding with ? could (and probably should) be used for the password when creating the user, but not elsewhere
  • The issue https://github.com/golang/go/issues/18478 (intentionally not linked to avoid a spammy backlink) has been open for many years on providing escaping in database/sql, which I believe gorm is built on. Seems unlikely that will go anywhere.
  • The postgres docs on syntax are here. The important part, which is what the above examples from pg8000 do:

    Quoted identifiers can contain any character, except the character with code zero. (To include a double quote, write two double quotes.)

  • github.com/lib/pq has a QuoteIdentifier function here. That's probably exactly what we want. It doesn't cover the \0-containing edge case, but should be good enough.

from homer-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.