Comments (2)
You can use any number of parameters with the library, as this library does not parse the query string, it just passes it to the server to handle.
You seem to be doing the parsing yourself, by monkey patching Query.submit.
What are you trying to achieve? Are you trying to avoid the extended protocol for some reason?
from node-postgres.
sorry @boromisp , my bad. It was a mistake in the snippet that you refer. I found it in the web to log the queries. Not sure if the library has support for logging queries, for that I looked into the web for some logging approach.
import { Pool } from "pg";
const connection = new Pool({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
port: +process.env.DB_PORT! || 5432,
});
const test = async () => {
const result = await connection.query(
`SELECT
$1 a,
$2 b,
$3 c,
$4 d,
$5 e,
$6 f,
$7 g,
$8 h,
$9 i,
$10 j,
$11 k,
$12 l
`,
[
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
"foo",
]
);
console.log(result.rows[0]);
};
(async () => await test())();
And all was resolved fine.
from node-postgres.
Related Issues (20)
- SASL: Last message was not SASLResponse HOT 7
- Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string HOT 7
- SyntaxError: Cannot use import statement outside a module HOT 2
- bind message supplies 1 parameters, but prepared statement "" requires 8 HOT 2
- Inserting now() at time zone 'utc' gives invalid results HOT 4
- Errors with Vite+Vue / Nuxt+Vue HOT 4
- How to avoid serialization when using setTypeParser? HOT 4
- Procedure names being converted HOT 1
- [Question] How to print parameterize query? HOT 1
- error: relation "users" does not exist HOT 5
- [question] How to prevent database disconnects from crashing Node.js? HOT 1
- Timezone not set on pool event 'connect' HOT 2
- Fails creating pg client on FIPS environment HOT 1
- Unexpected NULL timestamp during some queries HOT 3
- Type of result.rows is any[][] instead of any[] ? HOT 1
- GSS authorization to connect to the database.
- [question] would a PR that adds JSDOC be welcome?
- Pg is ignoring the time zone ( 'Asia/Kolkata' ) that I provided and is returning time into UTC format. I tried converting the time back to my local time but it is not returnng as expected HOT 2
- pg-connection-string: Shouldn't idleTimeoutMillis be considered? For pool usage patterns?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-postgres.