Skip to content

SQL library code #18

@ForbesLindesay

Description

@ForbesLindesay

Hi @calebmer - I can't keep track of a discussion in a large commit, so if you want to discuss it, let's talk here.

Regarding the source of the code, the initial version is loosely based on the pg-sql implementation. I'd be happy to provide some sort of attribution if you'd like? I put this implementation into this code base for a few reasons though:

  • I wanted to use TypeScript for it natively, to match the rest of the code base
  • I wanted to also support generating slightly different output for different SQL dialects (not all of them support the explicit $1 style placeholder syntax)
  • The various db libraries here are very tightly integrated with that package, so I need to be able to manage version updates carefully.
  • I felt it was important that sql.raw had a value that was more obviously dangerous.

Regarding the symbols in pg-sql2, this library uses instanceof, which is equivalently secure - you can't create an instance of SQLQuery via JSON.parse.

Let me know if you have any other concerns/if you want specific attribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions