Comparing version 1.0.253 to 1.0.254
@@ -215,3 +215,4 @@ "use strict"; | ||
// mutations | ||
$update: table_name => `UPDATE ${table_name}`, $set: items => `SET ${items | ||
// table_name === true is for FOR UPDATE statements | ||
$update: table_name => `UPDATE ${table_name === true ? '' : table_name}`, $set: items => `SET ${items | ||
.map(([column, value]) => `${column} = ${value}`) | ||
@@ -222,3 +223,3 @@ .join(', ')}`, $delete_from: table_name => `DELETE FROM ${table_name}`, $distinct: column_name => `DISTINCT (${column_name})`, $insert_into: ([table_name, [...columns]]) => `INSERT INTO ${table_name} (${columns.join(', ')})`, $values: (values) => `VALUES ${values | ||
// DML commands | ||
$select: args => `SELECT ${args.join(', ')}`, $as: args => `${wrap_if_subquery(args[0])} AS ${args[1]}`, $entity: (args, path, obj, database_type) => `${escape_field(args, database_type)}`, $field: (args, path, obj, database_type) => `.${escape_field(args, database_type)}`, $from: (args, path, obj, database_type) => `FROM ${escape_field(args, database_type)}`, $where: args => `WHERE ${args}`, $group_by: args => `GROUP BY ${args.join(', ')}`, $having: args => `HAVING ${args}`, $order_by: args => `ORDER BY ${args.join(', ')}`, $asc: args => `${args} ASC`, $desc: args => `${args} DESC`, $limit: args => `LIMIT ${args}`, $offset: args => `OFFSET ${args}`, $in: (args, path) => { | ||
$select: args => `SELECT ${args.join(', ')}`, $as: args => `${wrap_if_subquery(args[0])} AS ${args[1]}`, $entity: (args, path, obj, database_type) => `${escape_field(args, database_type)}`, $field: (args, path, obj, database_type) => `.${escape_field(args, database_type)}`, $from: (args, path, obj, database_type) => `FROM ${escape_field(args, database_type)}`, $where: args => `WHERE ${args}`, $group_by: args => `GROUP BY ${args.join(', ')}`, $having: args => `HAVING ${args}`, $order_by: args => `ORDER BY ${args.join(', ')}`, $for: args => `FOR ${args}`, $share: args => `SHARE ${args}`, $of: args => `OF ${args.join(', ')}`, $no_wait: args => `NOWAIT ${args}`, $skip_locked: args => `SKIP LOCKED ${args}`, $asc: args => `${args} ASC`, $desc: args => `${args} DESC`, $limit: args => `LIMIT ${args}`, $offset: args => `OFFSET ${args}`, $in: (args, path) => { | ||
const [left_arg, right_arg] = args; | ||
@@ -225,0 +226,0 @@ const left_arg_string = Array.isArray(left_arg) |
{ | ||
"name": "orma", | ||
"version": "1.0.253", | ||
"version": "1.0.254", | ||
"description": "A declarative relational syncronous orm", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -294,3 +294,4 @@ /** | ||
// mutations | ||
$update: table_name => `UPDATE ${table_name}`, | ||
// table_name === true is for FOR UPDATE statements | ||
$update: table_name => `UPDATE ${table_name === true ? '' : table_name}`, | ||
$set: items => | ||
@@ -322,2 +323,7 @@ `SET ${items | ||
$order_by: args => `ORDER BY ${args.join(', ')}`, | ||
$for: args => `FOR ${args}`, | ||
$share: args => `SHARE ${args}`, | ||
$of: args => `OF ${args.join(', ')}`, | ||
$no_wait: args => `NOWAIT ${args}`, | ||
$skip_locked: args => `SKIP LOCKED ${args}`, | ||
$asc: args => `${args} ASC`, | ||
@@ -324,0 +330,0 @@ $desc: args => `${args} DESC`, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1674402
40818