-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # doc/struct.md
- Loading branch information
Showing
15 changed files
with
161 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
# @teqfw/db | ||
|
||
TeqFW: DB connectivity. | ||
|CAUTION: TeqFW is an unstable, fast-growing project w/o backward compatibility. Use it at your own risk.| | ||
|---| | ||
|
||
TeqFW: DB connectivity based on [knex](https://knexjs.org/) package. | ||
|
||
## Install | ||
|
||
## Backend connector | ||
```shell | ||
$ npm i @teqfw/db --save | ||
``` | ||
|
||
Backend connector uses [knex](https://knexjs.org/) library. | ||
## Namespace | ||
|
||
This plugin uses `TeqFw_Db` namespace. | ||
|
||
## `./cfg/local.json` | ||
|
||
[DTO](src/Back/Dto/Config/Local.mjs) for `@teqfw/db` node. | ||
|
||
```json | ||
{ | ||
"@teqfw/db": { | ||
"client": "mysql2|pg|...", | ||
"connection": { | ||
"database": "duplo", | ||
"filename": "/.../db.sqlite", | ||
"flags": ["for", "SQLite"], | ||
"host": "127.0.0.1", | ||
"password": "...", | ||
"port": 3210, | ||
"socketPath": "/path/to/socket", | ||
"user": "name" | ||
}, | ||
"searchPath": ["PostgreSQL client allows you to set the initial search path"], | ||
"useNullAsDefault": true, | ||
"version": "When you use the PostgreSQL adapter to connect a non-standard database." | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* DTO for DEM 'entity/relation/action'. | ||
*/ | ||
// MODULE'S VARS | ||
const NS = 'TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action'; | ||
|
||
// MODULE'S CLASSES | ||
export default class TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action { | ||
/** @type {TeqFw_Db_Back_Enum_Dem_Type_Action} */ | ||
delete; | ||
/** @type {TeqFw_Db_Back_Enum_Dem_Type_Action} */ | ||
update; | ||
} | ||
|
||
/** | ||
* Factory to create new DTO instances. | ||
* @memberOf TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action | ||
*/ | ||
export class Factory { | ||
constructor(spec) { | ||
/** @type {TeqFw_Core_Shared_Util_Cast.castEnum|function} */ | ||
const castEnum = spec['TeqFw_Core_Shared_Util_Cast.castEnum']; | ||
/** @type {typeof TeqFw_Db_Back_Enum_Dem_Type_Action} */ | ||
const ACTION = spec['TeqFw_Db_Back_Enum_Dem_Type_Action#']; | ||
|
||
/** | ||
* @param {TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action|null} data | ||
* @return {TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action} | ||
*/ | ||
this.create = function (data = null) { | ||
const res = new TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action(); | ||
res.delete = castEnum(data?.delete, ACTION); | ||
res.update = castEnum(data?.update, ACTION); | ||
return res; | ||
} | ||
} | ||
} | ||
|
||
// finalize code components for this es6-module | ||
Object.freeze(TeqFw_Db_Back_Dto_Dem_Entity_Relation_Action); | ||
Object.defineProperty(Factory, 'name', {value: `${NS}.${Factory.constructor.name}`}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.