spooder 4.5.3 → 4.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/api.ts +6 -2
package/README.md CHANGED
@@ -1485,7 +1485,7 @@ const connection = await pool.getConnection();
1485
1485
  The schema directory is expected to contain an SQL file for each table in the database with the file name matching the name of the table.
1486
1486
 
1487
1487
  > [!NOTE]
1488
- > Files without the `.sql` extension (case-insensitive) will be ignored.
1488
+ > The schema directory is searched recursively and files without the `.sql` extension (case-insensitive) will be ignored.
1489
1489
 
1490
1490
  ```
1491
1491
  - database.sqlite
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spooder",
3
3
  "type": "module",
4
- "version": "4.5.3",
4
+ "version": "4.5.4",
5
5
  "exports": {
6
6
  ".": {
7
7
  "bun": "./src/api.ts",
package/src/api.ts CHANGED
@@ -232,9 +232,13 @@ type SchemaVersionMap = Map<string, number>;
232
232
 
233
233
  async function db_load_schema(schema_dir: string, schema_versions: SchemaVersionMap) {
234
234
  const schema_out = [];
235
- const schema_files = await fs.readdir(schema_dir);
235
+ const schema_files = await fs.readdir(schema_dir, { recursive: true, withFileTypes: true });
236
236
 
237
- for (const schema_file of schema_files) {
237
+ for (const schema_file_ent of schema_files) {
238
+ if (schema_file_ent.isDirectory())
239
+ continue;
240
+
241
+ const schema_file = schema_file_ent.name;
238
242
  const schema_file_lower = schema_file.toLowerCase();
239
243
  if (!schema_file_lower.endsWith('.sql'))
240
244
  continue;