mysql2-core 0.2.4 → 0.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2-core",
3
- "version": "0.2.4",
3
+ "version": "0.3.1",
4
4
  "description": "mysql2-core",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/build.ts CHANGED
@@ -59,7 +59,7 @@ export function metadata(attrs: Attributes): Metadata {
59
59
  }
60
60
  return m
61
61
  }
62
- export function buildToSave<T>(obj: T, table: string, attrs: Attributes, ver?: string, buildParam?: (i: number) => string, i?: number): Statement | undefined {
62
+ export function buildToSave<T>(obj: T, table: string, attrs: Attributes, ver?: string, buildParam?: (i: number) => string, i?: number): Statement {
63
63
  if (!i) {
64
64
  i = 1
65
65
  }
@@ -120,7 +120,7 @@ export function buildToSave<T>(obj: T, table: string, attrs: Attributes, ver?: s
120
120
  }
121
121
  if (pks.length === 0) {
122
122
  if (cols.length === 0) {
123
- return undefined
123
+ return { query: "", params: args }
124
124
  } else {
125
125
  const q = `insert into ${table}(${cols.join(",")})values(${values.join(",")})`
126
126
  return { query: q, params: args }