"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.testFun = void 0;
const drizzle_orm_1 = require("drizzle-orm");
const serializer_1 = __importDefault(require("drizzle-orm/serializer/serializer"));
const type_1 = __importDefault(require("drizzle-orm/types/type"));
const pg_1 = require("pg");
const i1 = __importStar(require("./data/_prev/multi"));
const db = new drizzle_orm_1.DB(new pg_1.Pool());
const serializer = new serializer_1.default();
// type Constructor<T = any> = new (...args: any[]) => T;
// function isConstructor<T>(type: Constructor<T>): boolean {
//   if (typeof type !== 'function') return false;
//   return !!Reflect.get('__class__', type);
// }
const testFun = () => {
    const tables = [];
    const enums = [];
    const i1values = Object.values(i1);
    i1values.forEach((t) => {
        if (t instanceof type_1.default) {
            enums.push(t);
            return;
        }
        if (typeof t === 'function' && t.prototype && t.prototype.constructor) {
            const instance = new t(db);
            if (instance instanceof drizzle_orm_1.AbstractTable) {
                tables.push(instance);
            }
        }
    });
    return serializer.generate(tables, enums);
};
exports.testFun = testFun;
//# sourceMappingURL=testiko.js.map