3

Use parameterized Statements for Postgres export · Issue #30 · getsynth/synth ·...

 3 years ago
source link: https://github.com/getsynth/synth/issues/30
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

llogiq commented 4 days ago

Required Functionality
Currently, the postgres export statements are build as strings. See postgres.sql:91 and following.

Proposed Solution
Make it use a prepared statement instead. This requires implementing ToSql on our Value implementation and creating a function that builds the SQL statement from a given list of columns for the namespace.

Use case
Not only will this make the export faster by removing the Value → String → Value roundtrip, it will also reduce the avenues for errors because of failing to escape data (if someone manages to generate bobby tables).


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK