@ronin/compiler 0.17.14 → 0.17.15

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/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  /** Query types used for reading data. */
2
- declare const DML_READ_QUERY_TYPES: readonly ["get", "count"];
2
+ declare const DML_QUERY_TYPES_READ: readonly ["get", "count"];
3
3
  /** Query types used for writing data. */
4
- declare const DML_WRITE_QUERY_TYPES: readonly ["set", "add", "remove"];
4
+ declare const DML_QUERY_TYPES_WRITE: readonly ["set", "add", "remove"];
5
5
  /** Query types used for interacting with data. */
6
6
  declare const DML_QUERY_TYPES: readonly ["get", "count", "set", "add", "remove"];
7
7
  /** Query types used for interacting with the database schema. */
8
8
  declare const DDL_QUERY_TYPES: readonly ["create", "alter", "drop"];
9
+ /** All query types. */
10
+ declare const QUERY_TYPES: readonly ["get", "count", "set", "add", "remove", "create", "alter", "drop"];
9
11
  /**
10
12
  * A list of placeholders that can be located inside queries after those queries were
11
13
  * serialized into JSON objects.
@@ -473,4 +475,4 @@ declare class Transaction {
473
475
 
474
476
  declare const CLEAN_ROOT_MODEL: PublicModel;
475
477
 
476
- export { type AddInstructions, type AddQuery, type AddInstructions as AddQueryInstructions, type AlterQuery, type CombinedInstructions, type CountInstructions, type CountQuery, type CountInstructions as CountQueryInstructions, type CreateQuery, DDL_QUERY_TYPES, DML_QUERY_TYPES, DML_READ_QUERY_TYPES, DML_WRITE_QUERY_TYPES, type DropQuery, type ExpandedResult, type GetInstructions, type GetQuery, type GetInstructions as GetQueryInstructions, type PublicModel as Model, type ModelField, type ModelIndex, type ModelPreset, type ModelTrigger, QUERY_SYMBOLS, type Query, type QueryInstructionType as QueryInstruction, type QuerySchemaType, type QueryType, CLEAN_ROOT_MODEL as ROOT_MODEL, type RegularResult, type RemoveInstructions, type RemoveQuery, type RemoveInstructions as RemoveQueryInstructions, type Result, type ResultRecord, RoninError, type SetInstructions, type SetQuery, type SetInstructions as SetQueryInstructions, type Statement, type StoredObject, Transaction, type WithInstruction, getQuerySymbol };
478
+ export { type AddInstructions, type AddQuery, type AddInstructions as AddQueryInstructions, type AlterQuery, type CombinedInstructions, type CountInstructions, type CountQuery, type CountInstructions as CountQueryInstructions, type CreateQuery, DDL_QUERY_TYPES, DML_QUERY_TYPES, DML_QUERY_TYPES_READ, DML_QUERY_TYPES_WRITE, type DropQuery, type ExpandedResult, type GetInstructions, type GetQuery, type GetInstructions as GetQueryInstructions, type PublicModel as Model, type ModelField, type ModelIndex, type ModelPreset, type ModelTrigger, QUERY_SYMBOLS, QUERY_TYPES, type Query, type QueryInstructionType as QueryInstruction, type QuerySchemaType, type QueryType, CLEAN_ROOT_MODEL as ROOT_MODEL, type RegularResult, type RemoveInstructions, type RemoveQuery, type RemoveInstructions as RemoveQueryInstructions, type Result, type ResultRecord, RoninError, type SetInstructions, type SetQuery, type SetInstructions as SetQueryInstructions, type Statement, type StoredObject, Transaction, type WithInstruction, getQuerySymbol };
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  // src/utils/constants.ts
2
- var DML_READ_QUERY_TYPES = ["get", "count"];
3
- var DML_WRITE_QUERY_TYPES = ["set", "add", "remove"];
2
+ var DML_QUERY_TYPES_READ = ["get", "count"];
3
+ var DML_QUERY_TYPES_WRITE = ["set", "add", "remove"];
4
4
  var DML_QUERY_TYPES = [
5
- ...DML_READ_QUERY_TYPES,
6
- ...DML_WRITE_QUERY_TYPES
5
+ ...DML_QUERY_TYPES_READ,
6
+ ...DML_QUERY_TYPES_WRITE
7
7
  ];
8
8
  var DDL_QUERY_TYPES = ["create", "alter", "drop"];
9
+ var QUERY_TYPES = [...DML_QUERY_TYPES, ...DDL_QUERY_TYPES];
9
10
  var QUERY_SYMBOLS = {
10
11
  // Represents a sub query.
11
12
  QUERY: "__RONIN_QUERY",
@@ -1201,7 +1202,7 @@ var compileQueryInput = (defaultQuery, models, statementParams, options) => {
1201
1202
  if (queryType === "get" && !isJoiningMultipleRows && (single || instructions?.limitedTo)) {
1202
1203
  statement += handleLimitedTo(single, instructions?.limitedTo);
1203
1204
  }
1204
- if (DML_WRITE_QUERY_TYPES.includes(queryType) && returning) {
1205
+ if (DML_QUERY_TYPES_WRITE.includes(queryType) && returning) {
1205
1206
  statement += `RETURNING ${columns}`;
1206
1207
  }
1207
1208
  const mainStatement = {
@@ -2378,9 +2379,10 @@ var CLEAN_ROOT_MODEL = omit(ROOT_MODEL, ["system"]);
2378
2379
  export {
2379
2380
  DDL_QUERY_TYPES,
2380
2381
  DML_QUERY_TYPES,
2381
- DML_READ_QUERY_TYPES,
2382
- DML_WRITE_QUERY_TYPES,
2382
+ DML_QUERY_TYPES_READ,
2383
+ DML_QUERY_TYPES_WRITE,
2383
2384
  QUERY_SYMBOLS,
2385
+ QUERY_TYPES,
2384
2386
  CLEAN_ROOT_MODEL as ROOT_MODEL,
2385
2387
  RoninError,
2386
2388
  Transaction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronin/compiler",
3
- "version": "0.17.14",
3
+ "version": "0.17.15",
4
4
  "type": "module",
5
5
  "description": "Compiles RONIN queries to SQL statements.",
6
6
  "publishConfig": {