@nongt/visql-core 0.12.1 → 0.13.0

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.
@@ -156,7 +156,8 @@ export interface SubqueryNode extends Record<string, unknown> {
156
156
  }
157
157
  /** `x IN (a, b, c)` (issue 130): the right side of IN, its values one
158
158
  * item each — literals in the editor, each with the input of what it's
159
- * compared with; params and other values from code. IN's other right side
159
+ * compared with, or one param as the whole list (`listParam`); other
160
+ * values from code. IN's other right side
160
161
  * is a sub query. Also BETWEEN's right side (issue 169): its two bounds,
161
162
  * low then high (`x BETWEEN low AND high`, both included). NOT BETWEEN is
162
163
  * a `not` around one, as NOT IN is. */
@@ -164,6 +165,10 @@ export interface ListNode extends Record<string, unknown> {
164
165
  type: 'list';
165
166
  items: ExpressionNode[];
166
167
  }
168
+ /** The param that is all of a list (`x IN (:ids)`), not a relative date:
169
+ * the editor shows such a list as that param, whose values the host
170
+ * gives when the query runs. */
171
+ export declare function listParam(list: ListNode): ParamNode | undefined;
167
172
  export interface CaseNode extends Record<string, unknown>, ColumnCopy {
168
173
  type: 'case';
169
174
  subject?: ExpressionNode;
@@ -74,6 +74,9 @@ export declare function astToSql(pipeline: QueryPipeline, dialect: SqlDialect, o
74
74
  nullSafeEqual?: NullSafeEqual;
75
75
  /** How a calculation divides (see ParameterizedSqlOptions). */
76
76
  division?: Division;
77
+ /** Whether MySQL reads a backslash as an escape (see
78
+ * ParameterizedSqlOptions). */
79
+ backslashEscapes?: boolean;
77
80
  }): string;
78
81
  /** SQL with its values as bound parameters, for executing it. */
79
82
  export interface ParameterizedSql {
@@ -113,6 +116,11 @@ export interface ParameterizedSqlOptions {
113
116
  * fraction everywhere (`5 / 2` is 2.5), or `'native'`, each database's
114
117
  * own (2 in PostgreSQL and SQL Server for two whole numbers). */
115
118
  division?: Division;
119
+ /** MySQL only: whether the server reads a backslash in a string as an
120
+ * escape, as it does by default, so a text written into the SQL has its
121
+ * backslashes doubled. `false` for a server with NO_BACKSLASH_ESCAPES in
122
+ * its sql_mode, where doubling them would change the text. */
123
+ backslashEscapes?: boolean;
116
124
  }
117
125
  /** The query as SQL whose values — in WHERE, JOIN ON and SELECT, including
118
126
  * inside functions, IF/CASE and IN lists — are bound parameters rather than
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nongt/visql-core",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "The query logic of @nongt/visql, for a backend: load, check, scope, write SQL, import SQL, read query plans. No React, no dependencies.",
5
5
  "keywords": [
6
6
  "sql",