"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMutationOperations = exports.createQueryOperations = exports.QueryBuilder = exports.FetchAdapter = exports.GraphQLRequestError = void 0;
exports.createClient = createClient;
/**
 * ORM Client - createClient factory
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
const client_1 = require("./client");
const function_1 = require("./models/function");
const schema_1 = require("./models/schema");
const table_1 = require("./models/table");
const checkConstraint_1 = require("./models/checkConstraint");
const field_1 = require("./models/field");
const spatialRelation_1 = require("./models/spatialRelation");
const foreignKeyConstraint_1 = require("./models/foreignKeyConstraint");
const fullTextSearch_1 = require("./models/fullTextSearch");
const index_1 = require("./models/index");
const policy_1 = require("./models/policy");
const primaryKeyConstraint_1 = require("./models/primaryKeyConstraint");
const tableGrant_1 = require("./models/tableGrant");
const trigger_1 = require("./models/trigger");
const uniqueConstraint_1 = require("./models/uniqueConstraint");
const view_1 = require("./models/view");
const viewTable_1 = require("./models/viewTable");
const viewGrant_1 = require("./models/viewGrant");
const viewRule_1 = require("./models/viewRule");
const embeddingChunk_1 = require("./models/embeddingChunk");
const schemaGrant_1 = require("./models/schemaGrant");
const defaultPrivilege_1 = require("./models/defaultPrivilege");
const enum_1 = require("./models/enum");
const compositeType_1 = require("./models/compositeType");
const apiSchema_1 = require("./models/apiSchema");
const apiModule_1 = require("./models/apiModule");
const domain_1 = require("./models/domain");
const siteMetadatum_1 = require("./models/siteMetadatum");
const siteModule_1 = require("./models/siteModule");
const siteTheme_1 = require("./models/siteTheme");
const corsSetting_1 = require("./models/corsSetting");
const triggerFunction_1 = require("./models/triggerFunction");
const partition_1 = require("./models/partition");
const databaseTransfer_1 = require("./models/databaseTransfer");
const api_1 = require("./models/api");
const site_1 = require("./models/site");
const app_1 = require("./models/app");
const apiSetting_1 = require("./models/apiSetting");
const migrateFile_1 = require("./models/migrateFile");
const nodeTypeRegistry_1 = require("./models/nodeTypeRegistry");
const pubkeySetting_1 = require("./models/pubkeySetting");
const database_1 = require("./models/database");
const rlsSetting_1 = require("./models/rlsSetting");
const sqlAction_1 = require("./models/sqlAction");
const databaseSetting_1 = require("./models/databaseSetting");
const webauthnSetting_1 = require("./models/webauthnSetting");
const astMigration_1 = require("./models/astMigration");
const query_1 = require("./query");
const mutation_1 = require("./mutation");
var client_2 = require("./client");
Object.defineProperty(exports, "GraphQLRequestError", { enumerable: true, get: function () { return client_2.GraphQLRequestError; } });
Object.defineProperty(exports, "FetchAdapter", { enumerable: true, get: function () { return client_2.FetchAdapter; } });
var query_builder_1 = require("./query-builder");
Object.defineProperty(exports, "QueryBuilder", { enumerable: true, get: function () { return query_builder_1.QueryBuilder; } });
__exportStar(require("./select-types"), exports);
__exportStar(require("./models"), exports);
var query_2 = require("./query");
Object.defineProperty(exports, "createQueryOperations", { enumerable: true, get: function () { return query_2.createQueryOperations; } });
var mutation_2 = require("./mutation");
Object.defineProperty(exports, "createMutationOperations", { enumerable: true, get: function () { return mutation_2.createMutationOperations; } });
/**
 * Create an ORM client instance
 *
 * @example
 * ```typescript
 * const db = createClient({
 *   endpoint: 'https://api.example.com/graphql',
 *   headers: { Authorization: 'Bearer token' },
 * });
 *
 * // Query users
 * const users = await db.user.findMany({
 *   select: { id: true, name: true },
 *   first: 10,
 * }).execute();
 *
 * // Create a user
 * const newUser = await db.user.create({
 *   data: { name: 'John', email: 'john@example.com' },
 *   select: { id: true },
 * }).execute();
 * ```
 */
function createClient(config) {
    const client = new client_1.OrmClient(config);
    return {
        function: new function_1.FunctionModel(client),
        schema: new schema_1.SchemaModel(client),
        table: new table_1.TableModel(client),
        checkConstraint: new checkConstraint_1.CheckConstraintModel(client),
        field: new field_1.FieldModel(client),
        spatialRelation: new spatialRelation_1.SpatialRelationModel(client),
        foreignKeyConstraint: new foreignKeyConstraint_1.ForeignKeyConstraintModel(client),
        fullTextSearch: new fullTextSearch_1.FullTextSearchModel(client),
        index: new index_1.IndexModel(client),
        policy: new policy_1.PolicyModel(client),
        primaryKeyConstraint: new primaryKeyConstraint_1.PrimaryKeyConstraintModel(client),
        tableGrant: new tableGrant_1.TableGrantModel(client),
        trigger: new trigger_1.TriggerModel(client),
        uniqueConstraint: new uniqueConstraint_1.UniqueConstraintModel(client),
        view: new view_1.ViewModel(client),
        viewTable: new viewTable_1.ViewTableModel(client),
        viewGrant: new viewGrant_1.ViewGrantModel(client),
        viewRule: new viewRule_1.ViewRuleModel(client),
        embeddingChunk: new embeddingChunk_1.EmbeddingChunkModel(client),
        schemaGrant: new schemaGrant_1.SchemaGrantModel(client),
        defaultPrivilege: new defaultPrivilege_1.DefaultPrivilegeModel(client),
        enum: new enum_1.EnumModel(client),
        compositeType: new compositeType_1.CompositeTypeModel(client),
        apiSchema: new apiSchema_1.ApiSchemaModel(client),
        apiModule: new apiModule_1.ApiModuleModel(client),
        domain: new domain_1.DomainModel(client),
        siteMetadatum: new siteMetadatum_1.SiteMetadatumModel(client),
        siteModule: new siteModule_1.SiteModuleModel(client),
        siteTheme: new siteTheme_1.SiteThemeModel(client),
        corsSetting: new corsSetting_1.CorsSettingModel(client),
        triggerFunction: new triggerFunction_1.TriggerFunctionModel(client),
        partition: new partition_1.PartitionModel(client),
        databaseTransfer: new databaseTransfer_1.DatabaseTransferModel(client),
        api: new api_1.ApiModel(client),
        site: new site_1.SiteModel(client),
        app: new app_1.AppModel(client),
        apiSetting: new apiSetting_1.ApiSettingModel(client),
        migrateFile: new migrateFile_1.MigrateFileModel(client),
        nodeTypeRegistry: new nodeTypeRegistry_1.NodeTypeRegistryModel(client),
        pubkeySetting: new pubkeySetting_1.PubkeySettingModel(client),
        database: new database_1.DatabaseModel(client),
        rlsSetting: new rlsSetting_1.RlsSettingModel(client),
        sqlAction: new sqlAction_1.SqlActionModel(client),
        databaseSetting: new databaseSetting_1.DatabaseSettingModel(client),
        webauthnSetting: new webauthnSetting_1.WebauthnSettingModel(client),
        astMigration: new astMigration_1.AstMigrationModel(client),
        query: (0, query_1.createQueryOperations)(client),
        mutation: (0, mutation_1.createMutationOperations)(client),
    };
}
