viborm 1.9.0 → 1.9.1

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.
@@ -1,2 +0,0 @@
1
- import{n as e}from"./chunk-BuuaeEvq.mjs";import{t}from"./sql-BsBoKwaf.mjs";var InsertValue=class{},JoinedValue=class extends InsertValue{};const n=new WeakMap;var r=class RowsOf extends t{model;alias;judgement;where;constructor(e,t,n,r){super([`(viborm: rows of a model rendered outside a query)`],[]),this.model=e,this.alias=t,this.judgement=n,this.where=r}settle(e){RowsOf.fill(this,e)}};export{n as i,InsertValue as n,JoinedValue as r,r as t};
2
- //# sourceMappingURL=rows-of-Djavcb19.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rows-of-Djavcb19.mjs","names":[],"sources":["../src/query-engine/raptor3/shared/insert-value.ts","../src/query-engine/raptor3/shared/rows-of.ts"],"sourcesContent":["import type { AnyModel } from \"@schema/model\";\nimport type { Sql } from \"@sql\";\nimport type { Queries } from \"./query\";\nimport type { Input } from \"./schema\";\n\n/** What an {@link InsertValue} is given to compute its values with. */\nexport interface InsertValueContext {\n readonly model: AnyModel;\n /** The INSERT's rows, every value final but the computed ones. */\n readonly rows: readonly Input[];\n /** The field the value is written to. */\n readonly field: string;\n readonly queries: Queries;\n readonly dialect: \"postgresql\" | \"mysql\" | \"sqlite\";\n /**\n * Run one read in the operation (its transaction, if any) and return its\n * raw rows; absent where the operation cannot read before writing (an\n * array transaction's batch), so the value must be an SQL expression.\n */\n readonly read?: (statement: Sql) => Promise<readonly Input[]>;\n}\n\n/**\n * A create value its extension computes once the rows of one INSERT are\n * final, after every incoming foreign key is assigned: a stamp of the `data`\n * capability that is an instance of this class is written where the caller\n * left the field out, not admitted as data. `compute` answers one value per\n * row it is asked about (the indexes of `rows` whose field holds this\n * instance), each a plain value or an SQL expression the INSERT evaluates.\n * An `update`'s data may hold one too (an official extension's call, never a\n * caller's payload): set aside from admission, its expression is the SET's.\n * The official ordering extension's appended and moved keys are the ones.\n */\nexport abstract class InsertValue {\n abstract compute(\n context: InsertValueContext,\n indexes: readonly number[]\n ): readonly unknown[] | Promise<readonly unknown[]>;\n}\n\n/**\n * An `updateMany` value read from a derived table the UPDATE joins (an\n * official extension's call, never a caller's payload): `join` answers that\n * table, aliased, and the condition matching it to the row written, over the\n * target's columns qualified by `target`; `compute` answers the SET\n * expression over the table's columns. The engine joins it (`UPDATE … FROM`,\n * MySQL's `UPDATE … JOIN`), so one statement writes each row its own value\n * and the source is read once, before any row changes. Respacing's keys.\n */\nexport abstract class JoinedValue extends InsertValue {\n abstract join(\n queries: Queries,\n target: string\n ): { readonly source: Sql; readonly on: Sql };\n}\n\n/**\n * Each engine's renderer, by its schema then its driver's adapter: an\n * official extension that writes a statement of its own (ordering's\n * respacing) names tables and columns and binds values as the engine's\n * queries do, without importing the engine into its entry.\n */\nexport const renderers = new WeakMap<object, WeakMap<object, Queries>>();\n","import type { AnyModel } from \"@schema/model\";\nimport { Sql } from \"../../../sql/sql\";\nimport type { RowJudgement } from \"./row-scope\";\n\n/**\n * The rows of `model` the operation rendering it may see, under `alias`: a\n * condition an extension that writes its own SQL (ordering's subqueries)\n * puts beside a read of `model AS alias`, so that read takes the call's row\n * domain as every read of the engine does. The operation's `Queries`\n * settles it when it lowers the caller's fragment holding it (the call's\n * root domain at that alias, or `1 = 1`); rendered anywhere else, its text\n * is not SQL, so it cannot read past the domain unnoticed. With `judgement`,\n * the rows the call may write so (an update of those fields); with `where`,\n * of those the ones it matches, admitted as a `findMany`'s.\n */\nexport class RowsOf extends Sql {\n readonly model: AnyModel;\n readonly alias: string;\n readonly judgement: RowJudgement | undefined;\n readonly where: unknown;\n constructor(\n model: AnyModel,\n alias: string,\n judgement?: RowJudgement,\n where?: unknown\n ) {\n super([\"(viborm: rows of a model rendered outside a query)\"], []);\n this.model = model;\n this.alias = alias;\n this.judgement = judgement;\n this.where = where;\n }\n settle(condition: Sql): void {\n RowsOf.fill(this, condition);\n }\n}\n"],"mappings":"2EAiCA,IAAsB,YAAtB,KAAkC,GAgBZ,YAAtB,cAA0C,WAAY,GAatD,MAAa,EAAY,IAAI,QC/C7B,IAAa,EAAb,MAAa,eAAe,CAAI,CAC9B,MACA,MACA,UACA,MACA,YACE,EACA,EACA,EACA,EACA,CACA,MAAM,CAAC,qDAAqD,CAAE,EAAE,CAAC,CACjE,KAAK,MAAQ,EACb,KAAK,MAAQ,EACb,KAAK,UAAY,EACjB,KAAK,MAAQ,EAEf,OAAO,EAAsB,CAC3B,OAAO,KAAK,KAAM,EAAU"}
@@ -1,2 +0,0 @@
1
- const e=`1.9.0`;export{e as t};
2
- //# sourceMappingURL=version-B7NRPl4T.mjs.map