You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot insert a boolean value true or false into the database using bind(), it only inserts properly when it's a "true" or "false" string.
FAIL __tests__/api/process-log-files/files-one.ts (8.711 s)
● /api/process-log-files › should process one file
TypeError: rawStr.toLowerCase is not a function
💥 This is a nasty error, which was unexpected by pg-mem. Also known "a bug" 😁 Please file an issue !
*️⃣ Failed SQL statement:
INSERT INTO venues
(id, premium_enabled)
VALUES ($1, $2);
👉 You can file an issue at https://github.com/oguimbal/pg-mem along with a way to reproduce this error (if you can), and the stacktrace:
Full Stacktrace
at value.setConversion.toBool.toBool (node_modules/pg-mem/src/datatypes/datatypes.ts:336:56)
at Evaluator.val (node_modules/pg-mem/src/evaluator.ts:125:28)
at Evaluator.get (node_modules/pg-mem/src/evaluator.ts:220:21)
at Insert.performMutation (node_modules/pg-mem/src/execution/records-mutations/insert.ts:149:62)
at Insert._doExecuteOnce (node_modules/pg-mem/src/execution/records-mutations/mutation-base.ts:60:29)
at Insert.enumerate (node_modules/pg-mem/src/execution/records-mutations/mutation-base.ts:72:29)
at enumerate.next (<anonymous>)
at SelectExec.execute (node_modules/pg-mem/src/execution/select.ts:279:41)
at node_modules/pg-mem/src/execution/statement-exec.ts:208:42
at pushExecutionCtx (node_modules/pg-mem/src/utils.ts:404:16)
at node_modules/pg-mem/src/execution/statement-exec.ts:196:54
at StatementExec.niceErrors (node_modules/pg-mem/src/execution/statement-exec.ts:226:20)
at StatementExec.executeStatement (node_modules/pg-mem/src/execution/statement-exec.ts:196:21)
at Bound.doExecute (node_modules/pg-mem/src/schema/prepared.ts:248:25)
at doExecute.next (<anonymous>)
at Bound.executeAll (node_modules/pg-mem/src/schema/prepared.ts:226:30)
at executeAll (__tests__/api/process-log-files/files-one.ts:18:49)
at Object.queryHub (__tests__/api/process-log-files/files-one.ts:456:5)
To Reproduce
// Create table
db.prepare(
`create table venues
(
id varchar(255) default NULL::character varying not null
primary key,
premium_enabled boolean default false
)`)
db.executeAll()
// Insert a boolean in table
db.prepare(
`INSERT INTO venues
(id, premium_enabled)
VALUES ($1, $2)`
db.bind(
["SOMEID", true]
)
db.executeAll()
pg-mem version
3.0.4
The text was updated successfully, but these errors were encountered:
Describe the bug
I cannot insert a boolean value
true
orfalse
into the database usingbind()
, it only inserts properly when it's a"true"
or"false"
string.Full Stacktrace
To Reproduce
pg-mem version
3.0.4
The text was updated successfully, but these errors were encountered: