Compare commits

..

No commits in common. "5810a834ab0c9c8f7201cb2b7a0b3dbf899520b4" and "fc9718f9a12b57efb42af5cb8d8b1b285067235d" have entirely different histories.

4 changed files with 2 additions and 7 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "dblang", "name": "dblang",
"version": "0.8.1", "version": "0.8.0",
"description": "", "description": "",
"main": "dist/db.js", "main": "dist/db.js",
"types": "dist/db.d.ts", "types": "dist/db.d.ts",

View file

@ -13,7 +13,7 @@ Features:
- [x] remove unused Schema - [x] remove unused Schema
- [x] joins - [x] joins
- [x] table alias - [x] table alias
- [x] general aliases - [x] generell aliases
- [x] unified response - [x] unified response
- [ ] change Schema - [ ] change Schema
- [ ] Key-Value Store Shortcut - [ ] Key-Value Store Shortcut

View file

@ -3,7 +3,6 @@ import { Attribute, DB, insertResponse, readResponse, Table, writeResponse } fro
import { Aggregation, checkConstraint, joinCross, Datatype, foreignConstraint, Modifier, joinNatural, onJoin, uniqueConstraint, usingJoin } from "./dbStructure.js" import { Aggregation, checkConstraint, joinCross, Datatype, foreignConstraint, Modifier, joinNatural, onJoin, uniqueConstraint, usingJoin } from "./dbStructure.js"
import { insertQuery, Query, QueryBuilder, removeQuery, selectQuery, updateQuery } from "./query.js" import { insertQuery, Query, QueryBuilder, removeQuery, selectQuery, updateQuery } from "./query.js"
import { allModifierInput, joinType, onAction, primaryData } from "./types.js" import { allModifierInput, joinType, onAction, primaryData } from "./types.js"
import { sha256 } from "./tools.js"
export class Handler { export class Handler {
db: DB; db: DB;
@ -572,7 +571,6 @@ export class Handler {
}, },
escapeID: (key: string): string => { escapeID: (key: string): string => {
if (!key || key === "" || key.includes('\u0000')) throw new Error("Can not escape empty key or with null unicode!"); if (!key || key === "" || key.includes('\u0000')) throw new Error("Can not escape empty key or with null unicode!");
if (key.length > 64) key = sha256(key);
if (key.match(/^`.+`$/g)) return key; if (key.match(/^`.+`$/g)) return key;
return `\`${key.replace(/`/g, '``')}\``; return `\`${key.replace(/`/g, '``')}\``;
}, },

View file

@ -1,3 +0,0 @@
import crypto from "crypto";
export const sha256 = (d: any) => crypto.createHash('sha256').update(String(d)).digest('base64');