✅ Complete Astro migration - PDPA compliant website
- Migrated all pages from Next.js to Astro - Added PDPA-compliant Privacy Policy (Thai) - Added PDPA-compliant Terms & Conditions (Thai) - Added Cookie Policy with disclosure (Thai) - Implemented cookie consent banner (client-side) - Integrated Umami Analytics placeholder - Blog system with 3 posts - Optimized Docker configuration for production - Static site build (184KB, 11 pages) - Ready for Easypanel deployment Backup: /Users/kunthawatgreethong/Gitea/dealplustech-backup-nextjs-20260309.tar.gz
This commit is contained in:
80
dealplustech-astro/node_modules/drizzle-orm/gel/driver.js
generated
vendored
Normal file
80
dealplustech-astro/node_modules/drizzle-orm/gel/driver.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { createClient } from "gel";
|
||||
import { entityKind } from "../entity.js";
|
||||
import { GelDatabase } from "../gel-core/db.js";
|
||||
import { GelDialect } from "../gel-core/dialect.js";
|
||||
import { DefaultLogger } from "../logger.js";
|
||||
import {
|
||||
createTableRelationsHelpers,
|
||||
extractTablesRelationalConfig
|
||||
} from "../relations.js";
|
||||
import { isConfig } from "../utils.js";
|
||||
import { GelDbSession } from "./session.js";
|
||||
class GelDriver {
|
||||
constructor(client, dialect, options = {}) {
|
||||
this.client = client;
|
||||
this.dialect = dialect;
|
||||
this.options = options;
|
||||
}
|
||||
static [entityKind] = "GelDriver";
|
||||
createSession(schema) {
|
||||
return new GelDbSession(this.client, this.dialect, schema, {
|
||||
logger: this.options.logger,
|
||||
cache: this.options.cache
|
||||
});
|
||||
}
|
||||
}
|
||||
class GelJsDatabase extends GelDatabase {
|
||||
static [entityKind] = "GelJsDatabase";
|
||||
}
|
||||
function construct(client, config = {}) {
|
||||
const dialect = new GelDialect({ casing: config.casing });
|
||||
let logger;
|
||||
if (config.logger === true) {
|
||||
logger = new DefaultLogger();
|
||||
} else if (config.logger !== false) {
|
||||
logger = config.logger;
|
||||
}
|
||||
let schema;
|
||||
if (config.schema) {
|
||||
const tablesConfig = extractTablesRelationalConfig(config.schema, createTableRelationsHelpers);
|
||||
schema = {
|
||||
fullSchema: config.schema,
|
||||
schema: tablesConfig.tables,
|
||||
tableNamesMap: tablesConfig.tableNamesMap
|
||||
};
|
||||
}
|
||||
const driver = new GelDriver(client, dialect, { logger, cache: config.cache });
|
||||
const session = driver.createSession(schema);
|
||||
const db = new GelJsDatabase(dialect, session, schema);
|
||||
db.$client = client;
|
||||
db.$cache = config.cache;
|
||||
if (db.$cache) {
|
||||
db.$cache["invalidate"] = config.cache?.onMutate;
|
||||
}
|
||||
return db;
|
||||
}
|
||||
function drizzle(...params) {
|
||||
if (typeof params[0] === "string") {
|
||||
const instance = createClient({ dsn: params[0] });
|
||||
return construct(instance, params[1]);
|
||||
}
|
||||
if (isConfig(params[0])) {
|
||||
const { connection, client, ...drizzleConfig } = params[0];
|
||||
if (client) return construct(client, drizzleConfig);
|
||||
const instance = createClient(connection);
|
||||
return construct(instance, drizzleConfig);
|
||||
}
|
||||
return construct(params[0], params[1]);
|
||||
}
|
||||
((drizzle2) => {
|
||||
function mock(config) {
|
||||
return construct({}, config);
|
||||
}
|
||||
drizzle2.mock = mock;
|
||||
})(drizzle || (drizzle = {}));
|
||||
export {
|
||||
GelDriver,
|
||||
GelJsDatabase,
|
||||
drizzle
|
||||
};
|
||||
//# sourceMappingURL=driver.js.map
|
||||
Reference in New Issue
Block a user