Reformat project into workspaces
CI/CD Pipeline / test (push) Failing after 1m51s
CI/CD Pipeline / deploy-internal (push) Has been skipped

This commit is contained in:
chris committed 2026-08-28 19:58:43 -04:00
1 parent 20bb10114b
commit c3e2cf5ed3
38 files changed
+4863 -4186

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
// structural interface to the test table
export interface CatetoryNode {
id: number;
name: string;
path: string; // ltree field
}
export class CategoryRepository {
// simulate generating a SQL query targeting child paths
generateDescendantsQuery(parentPath: string): { sql: string; values: string[] } {
return {
sql: 'SELECT id, name, path FROM categories WHERE path <@ $1::ltree',
values: [parentPath]
};
}
generateWildcardQuery(pattern: string): { sql: string, values: string[] } {
// Simulate genrating a SQL query using ltree wildcards
return {
sql: 'SELECT id, name, path FROM categories WHERE path ~ $1::lquery',
values: [pattern]
};
}
// helper utility to validate a string as an ltree value
isValidLtreePath(path: string): boolean {
const ltreeRegex = /^[A-Za-z0-9_]+(\.[A-Za-z0-9_]+)*$/;
return ltreeRegex.test(path);
}
}