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.
- package/README.md +1 -1
- package/package.json +1 -1
- 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
|
-
>
|
|
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
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
|
|
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;
|