← Files RivetARCHIVED FILE

node_modules/drizzle-orm/sqlite-core/query-builders/query.cjs

2.23 KB · Nov 5, 2026 · 12:09 UTC

↓ Download file

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
let __entity_ts = require("../../entity.cjs");
let __sql_sql_ts = require("../../sql/sql.cjs");

//#region src/sqlite-core/query-builders/query.ts
var RelationalQueryBuilder = class {
	static [__entity_ts.entityKind] = "SQLiteRelationalQueryBuilderV2";
	constructor(mode, schema, table, tableConfig, dialect, session, forbidJsonb, builder = SQLiteRelationalQuery) {
		this.mode = mode;
		this.schema = schema;
		this.table = table;
		this.tableConfig = tableConfig;
		this.dialect = dialect;
		this.session = session;
		this.forbidJsonb = forbidJsonb;
		this.builder = builder;
	}
	findMany(config) {
		return new this.builder(this.mode, this.schema, this.table, this.tableConfig, this.dialect, this.session, config ?? true, "many", this.forbidJsonb);
	}
	findFirst(config) {
		return new this.builder(this.mode, this.schema, this.table, this.tableConfig, this.dialect, this.session, config ?? true, "first", this.forbidJsonb);
	}
};
var SQLiteRelationalQuery = class {
	static [__entity_ts.entityKind] = "SQLiteRelationalQueryV2";
	/** @internal */
	mode;
	/** @internal */
	table;
	/** @internal */
	resultKind;
	constructor(resultKind, schema, table, tableConfig, dialect, session, config, mode, forbidJsonb) {
		this.schema = schema;
		this.tableConfig = tableConfig;
		this.dialect = dialect;
		this.session = session;
		this.config = config;
		this.forbidJsonb = forbidJsonb;
		this.resultKind = resultKind;
		this.mode = mode;
		this.table = table;
	}
	getSQL() {
		return this._getQuery().sql;
	}
	_getQuery() {
		const jsonb = this.forbidJsonb ? __sql_sql_ts.sql`json` : __sql_sql_ts.sql`jsonb`;
		return this.dialect.buildRelationalQuery({
			schema: this.schema,
			table: this.table,
			tableConfig: this.tableConfig,
			queryConfig: this.config,
			mode: this.mode,
			jsonb
		});
	}
	_toSQL() {
		const query = this._getQuery();
		return {
			query,
			builtQuery: this.dialect.sqlToQuery(query.sql)
		};
	}
	toSQL() {
		return this._toSQL().builtQuery;
	}
};

//#endregion
exports.RelationalQueryBuilder = RelationalQueryBuilder;
exports.SQLiteRelationalQuery = SQLiteRelationalQuery;
//# sourceMappingURL=query.cjs.map

SHA-256: dc939d2998efc24110d26ed14d9cb6e81c99f8b2db153841329d47fbe961aa32