@ronin/compiler 0.11.2 → 0.11.3-leo-ron-1083-1-experimental-234
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +4 -4
- package/dist/index.js +18 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -5990,14 +5990,14 @@ type NativeRecord = Record<string, unknown> & {
|
|
5990
5990
|
id: string;
|
5991
5991
|
ronin: {
|
5992
5992
|
locked: boolean;
|
5993
|
-
createdAt:
|
5993
|
+
createdAt: string;
|
5994
5994
|
createdBy: string | null;
|
5995
|
-
updatedAt:
|
5995
|
+
updatedAt: string;
|
5996
5996
|
updatedBy: string | null;
|
5997
5997
|
};
|
5998
5998
|
};
|
5999
|
-
type SingleRecordResult = {
|
6000
|
-
record:
|
5999
|
+
type SingleRecordResult<T = NativeRecord> = {
|
6000
|
+
record: T | null;
|
6001
6001
|
};
|
6002
6002
|
type MultipleRecordResult = {
|
6003
6003
|
records: Array<NativeRecord>;
|
package/dist/index.js
CHANGED
@@ -1256,7 +1256,7 @@ var handleSelecting = (models, model, statementParams, instructions, options) =>
|
|
1256
1256
|
}
|
1257
1257
|
const expandColumns = isJoining && options?.expandColumns;
|
1258
1258
|
if (expandColumns) {
|
1259
|
-
instructions.selecting = model.fields.map((field) => field.slug);
|
1259
|
+
instructions.selecting = model.fields.filter((field) => !(field.type === "link" && field.kind === "many")).map((field) => field.slug);
|
1260
1260
|
}
|
1261
1261
|
if (instructions.selecting) {
|
1262
1262
|
const usableModel = expandColumns ? { ...model, tableAlias: model.tableAlias || model.table } : model;
|
@@ -1672,22 +1672,31 @@ var Transaction = class {
|
|
1672
1672
|
records: this.formatRows(fields, rows, single)
|
1673
1673
|
};
|
1674
1674
|
if (pageSize && output.records.length > 0) {
|
1675
|
-
if (
|
1676
|
-
|
1677
|
-
|
1675
|
+
if (output.records.length > pageSize) {
|
1676
|
+
if (queryInstructions?.before) {
|
1677
|
+
output.records.shift();
|
1678
|
+
} else {
|
1679
|
+
output.records.pop();
|
1680
|
+
}
|
1681
|
+
const direction = queryInstructions?.before ? "moreBefore" : "moreAfter";
|
1682
|
+
const lastRecord = output.records.at(
|
1683
|
+
direction === "moreAfter" ? -1 : 0
|
1684
|
+
);
|
1678
1685
|
output[direction] = generatePaginationCursor(
|
1679
1686
|
model,
|
1680
1687
|
queryInstructions.orderedBy,
|
1681
|
-
|
1688
|
+
lastRecord
|
1682
1689
|
);
|
1683
1690
|
}
|
1684
|
-
if (
|
1685
|
-
const direction = queryInstructions?.before ? "
|
1686
|
-
const
|
1691
|
+
if (queryInstructions?.before || queryInstructions?.after) {
|
1692
|
+
const direction = queryInstructions?.before ? "moreAfter" : "moreBefore";
|
1693
|
+
const firstRecord = output.records.at(
|
1694
|
+
direction === "moreAfter" ? -1 : 0
|
1695
|
+
);
|
1687
1696
|
output[direction] = generatePaginationCursor(
|
1688
1697
|
model,
|
1689
1698
|
queryInstructions.orderedBy,
|
1690
|
-
|
1699
|
+
firstRecord
|
1691
1700
|
);
|
1692
1701
|
}
|
1693
1702
|
}
|