sql-typechecker 0.0.85 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/cli.js CHANGED
@@ -243745,7 +243745,7 @@ ${f.name?.name}?: ${showTypeAsTypescriptType(f.type)}`).join(",");
243745
243745
  const insert = `
243746
243746
  export async function insert(pool: Pool, row: {${inputRow}}): Promise<{${primaryKeySingleCol.name.name}: ${showTypeAsTypescriptType(primaryKeySingleCol.type)}}>{
243747
243747
 
243748
- const providedFields = Object.keys(row).filter(key => allowedFieldNames.includes(key)) as (keyof typeof row)[];
243748
+ const providedFields = (Object.keys(row) as (keyof typeof row)[]).filter(key => row[key] !== undefined && allowedFieldNames.includes(key)) ;
243749
243749
 
243750
243750
  const res = await pool.query({
243751
243751
  text: "INSERT INTO ${showQName(table.name)} (" + (providedFields.join(", ")) + ") VALUES (" + providedFields.map((_, i) => "$" + (i + 1)).join(", ") +") RETURNING ${primaryKeySingleCol.name.name}",