All files / test/db index.ts

0% Statements 0/45
0% Branches 0/1
0% Functions 0/1
0% Lines 0/45

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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46                                                                                           
import {realm, type ModuleApi} from '@feasibleone/blong';
// @ts-expect-error -- no type declarations for ut-port-sql
import sqlPort from 'ut-port-sql';

export default realm(blong => ({
    url: import.meta.url,
    validation: blong.type.Object({}),
    children: [
        function adapter(layer: ModuleApi) {
            return layer.sql(
                class extends sqlPort(layer) {
                    public get defaults(): object {
                        return {
                            cache: true,
                            connectionTimeout: 60000,
                            requestTimeout: 60000,
                            concurrency: 200,
                            create: false,
                            createTT: true,
                            doc: false,
                            linkSP: true,
                            logLevel: 'info',
                            retry: false,
                            updates: false,
                            imports: [
                                /(^|\.)sql$|\.sqlPolicy$/,
                                /(^|\.)sqlSeed$/,
                                /(^|\.)sqlData/,
                                /(^|\.)sqlStandard$/,
                                // test && /(^|\.)sql(Unit)?Test$/,
                                /(^|\.)sqlExternal$/,
                            ].filter(Boolean),
                        };
                    }
                },
            );
        },
    ],
    config: {
        default: {},
        microservice: {
            adapter: true,
        },
    },
}));