inibase 1.6.3 → 1.6.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 +5 -0
- package/dist/index.js +6 -3
- package/dist/utils.js +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -633,6 +633,11 @@ const db = new Inibase("/databaseName");
|
|
|
633
633
|
const users = await db.get("user", undefined, {
|
|
634
634
|
columns: ["!username", "!address.street"],
|
|
635
635
|
});
|
|
636
|
+
|
|
637
|
+
// Get all columns explicitly with the "*" wildcard
|
|
638
|
+
const all = await db.get("user", undefined, {
|
|
639
|
+
columns: ["*"],
|
|
640
|
+
});
|
|
636
641
|
```
|
|
637
642
|
|
|
638
643
|
</blockquote>
|
package/dist/index.js
CHANGED
|
@@ -1110,7 +1110,8 @@ export default class Inibase {
|
|
|
1110
1110
|
? options.columns
|
|
1111
1111
|
: [options.columns];
|
|
1112
1112
|
for (const column of options.columns)
|
|
1113
|
-
|
|
1113
|
+
if (column !== "*")
|
|
1114
|
+
this.validateName(column);
|
|
1114
1115
|
if (options.columns.length && !options.columns.includes("id"))
|
|
1115
1116
|
options.columns.push("id");
|
|
1116
1117
|
}
|
|
@@ -1358,7 +1359,8 @@ export default class Inibase {
|
|
|
1358
1359
|
for (const column of (Array.isArray(options.columns)
|
|
1359
1360
|
? options.columns
|
|
1360
1361
|
: [options.columns]))
|
|
1361
|
-
|
|
1362
|
+
if (column !== "*")
|
|
1363
|
+
this.validateName(column);
|
|
1362
1364
|
const tablePath = join(this.databasePath, tableName);
|
|
1363
1365
|
await this.getTable(tableName);
|
|
1364
1366
|
if (!globalConfig[this.databasePath].tables?.get(tableName)?.schema)
|
|
@@ -1444,7 +1446,8 @@ export default class Inibase {
|
|
|
1444
1446
|
for (const column of (Array.isArray(options.columns)
|
|
1445
1447
|
? options.columns
|
|
1446
1448
|
: [options.columns]))
|
|
1447
|
-
|
|
1449
|
+
if (column !== "*")
|
|
1450
|
+
this.validateName(column);
|
|
1448
1451
|
const tablePath = join(this.databasePath, tableName);
|
|
1449
1452
|
await this.throwErrorIfTableEmpty(tableName);
|
|
1450
1453
|
let clonedData = structuredClone(data);
|
package/dist/utils.js
CHANGED
|
@@ -740,7 +740,6 @@ export const createError = (language, name, variable) => {
|
|
|
740
740
|
export const isValidName = (input) => typeof input === "string" &&
|
|
741
741
|
input.length > 0 &&
|
|
742
742
|
input.length <= 255 &&
|
|
743
|
-
input !== "*" &&
|
|
744
743
|
validNamePattern.test(input);
|
|
745
744
|
// Word characters: Latin alphanumerics, underscores, hyphens and Arabic blocks.
|
|
746
745
|
const nameWordCharClass = "a-zA-Z0-9_\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF-";
|