All files / blong-int-adapter/mysql/adapter/sql sqlSchemaCrudBind.ts

58.33% Statements 14/24
100% Branches 1/1
0% Functions 0/1
58.33% Lines 14/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                     1x  
import {handler} from '@feasibleone/blong';
import {schemaItemSchema} from './schemaItemSchema.ts';
 
/**
 * sqlSchemaCrudBind — calls the knex adapter's built-in `schemaCrudBind` method
 * to generate CRUD handler functions for the `schema_item` table.
 *
 * Returns the generated `handlers` map so the test layer can invoke CRUD
 * operations directly without having to wire them as separate API methods.
 */
export default handler(
    () =>
        async function sqlSchemaCrudBind(
            _params: Record<string, unknown>,
            _$meta: Record<string, unknown>,
        ) {
            return (
                this.schemaCrudBind as (...args: unknown[]) => Promise<{
                    handlers: Record<string, (params: Record<string, unknown>) => Promise<unknown>>;
                    schemas: Record<string, unknown>;
                }>
            )('sql', 'schemaItem', schemaItemSchema, [], 'schema_item');
        },
);