@ronin/compiler 0.17.14-leo-ron-1113-experimental-405 → 0.17.14
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 +3 -5
- package/dist/index.js +7 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
/** Query types used for reading data. */
|
2
|
-
declare const
|
2
|
+
declare const DML_READ_QUERY_TYPES: readonly ["get", "count"];
|
3
3
|
/** Query types used for writing data. */
|
4
|
-
declare const
|
4
|
+
declare const DML_WRITE_QUERY_TYPES: 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"];
|
11
9
|
/**
|
12
10
|
* A list of placeholders that can be located inside queries after those queries were
|
13
11
|
* serialized into JSON objects.
|
@@ -475,4 +473,4 @@ declare class Transaction {
|
|
475
473
|
|
476
474
|
declare const CLEAN_ROOT_MODEL: PublicModel;
|
477
475
|
|
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,
|
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 };
|
package/dist/index.js
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
// src/utils/constants.ts
|
2
|
-
var
|
3
|
-
var
|
2
|
+
var DML_READ_QUERY_TYPES = ["get", "count"];
|
3
|
+
var DML_WRITE_QUERY_TYPES = ["set", "add", "remove"];
|
4
4
|
var DML_QUERY_TYPES = [
|
5
|
-
...
|
6
|
-
...
|
5
|
+
...DML_READ_QUERY_TYPES,
|
6
|
+
...DML_WRITE_QUERY_TYPES
|
7
7
|
];
|
8
8
|
var DDL_QUERY_TYPES = ["create", "alter", "drop"];
|
9
|
-
var QUERY_TYPES = [...DML_QUERY_TYPES, ...DDL_QUERY_TYPES];
|
10
9
|
var QUERY_SYMBOLS = {
|
11
10
|
// Represents a sub query.
|
12
11
|
QUERY: "__RONIN_QUERY",
|
@@ -1202,7 +1201,7 @@ var compileQueryInput = (defaultQuery, models, statementParams, options) => {
|
|
1202
1201
|
if (queryType === "get" && !isJoiningMultipleRows && (single || instructions?.limitedTo)) {
|
1203
1202
|
statement += handleLimitedTo(single, instructions?.limitedTo);
|
1204
1203
|
}
|
1205
|
-
if (
|
1204
|
+
if (DML_WRITE_QUERY_TYPES.includes(queryType) && returning) {
|
1206
1205
|
statement += `RETURNING ${columns}`;
|
1207
1206
|
}
|
1208
1207
|
const mainStatement = {
|
@@ -2379,10 +2378,9 @@ var CLEAN_ROOT_MODEL = omit(ROOT_MODEL, ["system"]);
|
|
2379
2378
|
export {
|
2380
2379
|
DDL_QUERY_TYPES,
|
2381
2380
|
DML_QUERY_TYPES,
|
2382
|
-
|
2383
|
-
|
2381
|
+
DML_READ_QUERY_TYPES,
|
2382
|
+
DML_WRITE_QUERY_TYPES,
|
2384
2383
|
QUERY_SYMBOLS,
|
2385
|
-
QUERY_TYPES,
|
2386
2384
|
CLEAN_ROOT_MODEL as ROOT_MODEL,
|
2387
2385
|
RoninError,
|
2388
2386
|
Transaction,
|