andywer/postguard

Query Parsing using spreadinsert

AgentGoldPaw opened this issue · 0 comments

I am probably doing something wrong

this is the table in code

const usersTable = defineTable("users", {
  uuid: Schema.default(Schema.Uuid),
  phone: Schema.String,
  created_ts: Schema.default(Schema.Date),
});

export async function queryCreateUser(
  record: NewUserRecord
): Promise<UserRecord> {
  const query = sql`
  INSERT INTO users ${spreadInsert(record)} RETURNING phone
`;

my postgres table does not have the phone column at this point in time. Should postguard catch this issue?