sasat 0.22.6 → 0.22.7

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.cjs CHANGED
@@ -147,7 +147,7 @@ const getLock = (lock) => {
147
147
  };
148
148
  const queryToSql = (query) => {
149
149
  const select = query.select.map(Sql.select).join(", ");
150
- const join = getJoin(query.from).map(Sql.join).join(" ");
150
+ const join = [...getJoin(query.from), ...query.join ?? []].map(Sql.join).join(" ");
151
151
  const where = query.where ? " WHERE " + Sql.booleanValue(query.where) : "";
152
152
  const groupBy = query.groupBy ? " GROUP BY" + query.groupBy.cols.map(Sql.value).join(",") : "";
153
153
  const having = query.having ? "HAVING " + Sql.booleanValue(query.having) : "";
package/dist/index.d.cts CHANGED
@@ -53,6 +53,7 @@ type Query = {
53
53
  limit?: number;
54
54
  offset?: number;
55
55
  lock?: LockMode;
56
+ join?: Join[];
56
57
  };
57
58
  type GroupByExpr = {
58
59
  kind: QueryNodeKind.GroupBy;
@@ -262,6 +263,7 @@ type QueryOptions = {
262
263
  limit?: number;
263
264
  offset?: number;
264
265
  lock?: LockMode;
266
+ join?: Join[];
265
267
  };
266
268
  declare abstract class SasatDBDatasource<Entity extends EntityType, Identifiable extends object, Creatable extends EntityType, Updatable extends Identifiable, EntityFields extends Fields<Entity>, QueryResult extends Partial<Entity> & Identifiable> implements Repository<Entity, Identifiable, Creatable, Updatable> {
267
269
  protected client: SQLExecutor;
package/dist/index.d.mts CHANGED
@@ -53,6 +53,7 @@ type Query = {
53
53
  limit?: number;
54
54
  offset?: number;
55
55
  lock?: LockMode;
56
+ join?: Join[];
56
57
  };
57
58
  type GroupByExpr = {
58
59
  kind: QueryNodeKind.GroupBy;
@@ -262,6 +263,7 @@ type QueryOptions = {
262
263
  limit?: number;
263
264
  offset?: number;
264
265
  lock?: LockMode;
266
+ join?: Join[];
265
267
  };
266
268
  declare abstract class SasatDBDatasource<Entity extends EntityType, Identifiable extends object, Creatable extends EntityType, Updatable extends Identifiable, EntityFields extends Fields<Entity>, QueryResult extends Partial<Entity> & Identifiable> implements Repository<Entity, Identifiable, Creatable, Updatable> {
267
269
  protected client: SQLExecutor;
package/dist/index.mjs CHANGED
@@ -145,7 +145,7 @@ const getLock = (lock) => {
145
145
  };
146
146
  const queryToSql = (query) => {
147
147
  const select = query.select.map(Sql.select).join(", ");
148
- const join = getJoin(query.from).map(Sql.join).join(" ");
148
+ const join = [...getJoin(query.from), ...query.join ?? []].map(Sql.join).join(" ");
149
149
  const where = query.where ? " WHERE " + Sql.booleanValue(query.where) : "";
150
150
  const groupBy = query.groupBy ? " GROUP BY" + query.groupBy.cols.map(Sql.value).join(",") : "";
151
151
  const having = query.having ? "HAVING " + Sql.booleanValue(query.having) : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasat",
3
- "version": "0.22.6",
3
+ "version": "0.22.7",
4
4
  "repository": "https://github.com/nin138/sasat.git",
5
5
  "author": "nin138 <ninian138@gmail.com>",
6
6
  "license": "MIT",