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
@Column('json', { default: {} })
@Type(type => Result)
@Reflect.metadata('design:type', Result)
public result: Result = {}
Error Query:
CREATE TABLE "candidate" ("phone" character varying(255), "industry" character varying(255), "years" integer, "degree" integer, "resume" json NOT NULL DEFAULT '[object Object]', "status" integer NOT NULL, "id" SERIAL NOT NULL PRIMARY KEY, "createAt" timestamp without time zone NOT NULL, "updateAt" timestamp without time zone NOT NULL, "version" integer NOT NULL, "location" integer, "creator" integer, "company" integer)
Error:
{ error: invalid input syntax for type json
at Connection.parseE (/var/app/current/node_modules/pg/lib/connection.js:554:11)
at Connection.parseMessage (/var/app/current/node_modules/pg/lib/connection.js:381:17)
at Socket.<anonymous> (/var/app/current/node_modules/pg/lib/connection.js:117:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at Socket.Readable.push (_stream_readable.js:130:10)
at TCP.onread (net.js:542:20)
name: 'error',
length: 157,
severity: 'ERROR',
code: '22P02',
detail: 'Token "object" is invalid.',
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: 'JSON data, line 1: [object...',
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'json.c',
line: '1243',
routine: 'report_invalid_token' }
Its not a workaround, its actual implementation. Default's value is just used in DEFAULT expression of sql. Right now its {} if you want to store an object there, later I have plans to change it to '{}' because of #150 . I think I can close this one.
Code:
Error Query:
Error:
Should the type of this field be constrained?
The text was updated successfully, but these errors were encountered: