@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
18 lines • 853 B
JavaScript
let cached = null;
/**
* Lazily import `node-sql-parser` and build a single shared {@link SqlParserLike}. The import lives here
* (not at any module's top level) so the package is only pulled in when the `data` tool is configured —
* keeping `node-sql-parser` an optional peer, exactly like `@adonisjs/lucid` is for the stores.
*/
export function loadSqlParser() {
if (cached === null) {
cached = import('node-sql-parser').then((mod) => {
// `node-sql-parser` is CJS: under Node ESM the named `Parser` export isn't surfaced, so reach it
// through the interop default. Fall back to a real named export for bundlers that do surface it.
const ParserCtor = mod.default?.Parser ?? mod.Parser;
return new ParserCtor();
});
}
return cached;
}
//# sourceMappingURL=parser.js.map