@designliquido/lincones-sqlite 0.0.1 → 0.0.2
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
CHANGED
|
@@ -12,4 +12,14 @@ Com o Node.js instalado, execute o seguinte comando em um prompt de comando (Ter
|
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
npm install -g @designliquido/lincones-sqlite
|
|
15
|
-
```
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Observação
|
|
18
|
+
|
|
19
|
+
Se você tem interesse em contribuir com o desenvolvimento do projeto, logo após fazer o clone e atualizar os pacotes com `yarn`, lembre-se de executar o seguinte comando:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
git submodule update --init --recursive --remote
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Com isso, você sincroniza com a versão mais recente de [lincones-js](https://github.com/DesignLiquido/lincones-js), que é o projeto base para lincones-sqlite.
|
|
@@ -22,10 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.ClienteSQLite = void 0;
|
|
27
30
|
const caminho = __importStar(require("node:path"));
|
|
28
31
|
const sqlite = __importStar(require("sqlite"));
|
|
32
|
+
const sqlite3_1 = __importDefault(require("sqlite3"));
|
|
29
33
|
class ClienteSQLite {
|
|
30
34
|
// Segundo a documentação, o método new sqlite3.Database()
|
|
31
35
|
// pode receber 3 formas de filename
|
|
@@ -43,7 +47,10 @@ class ClienteSQLite {
|
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
async abrir() {
|
|
46
|
-
const database = await sqlite.open(
|
|
50
|
+
const database = await sqlite.open({
|
|
51
|
+
filename: this.origemDados,
|
|
52
|
+
driver: sqlite3_1.default.Database
|
|
53
|
+
});
|
|
47
54
|
this.instanciaBancoDeDados = database;
|
|
48
55
|
console.log('Conectado ao banco de dados SQLite.');
|
|
49
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliente-sqlite.js","sourceRoot":"","sources":["../../../fontes/infraestrutura/cliente-sqlite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cliente-sqlite.js","sourceRoot":"","sources":["../../../fontes/infraestrutura/cliente-sqlite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AAErC,+CAAiC;AACjC,sDAA8B;AAE9B,MAAa,aAAa;IAKtB,0DAA0D;IAC1D,oCAAoC;IACpC,4CAA4C;IAC5C,qDAAqD;IACrD,+CAA+C;IAC/C,YAAY,cAA6B,IAAI;QACzC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,IAAI,WAAW,KAAK,UAAU,IAAI,WAAW,KAAK,IAAI,EAAE;YACpD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;SAClE;aAAM;YACH,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;SACjC;IACL,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;YAC/B,QAAQ,EAAE,IAAI,CAAC,WAAW;YAC1B,MAAM,EAAE,iBAAO,CAAC,QAAQ;SAC3B,CAAC,CAAC;QACH,IAAI,CAAC,qBAAqB,GAAG,QAAQ,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAe;QACxC,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YAC9B,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;SACrD;QAED,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAW,EAAE,EAAE;YACjE,IAAI,IAAI,EAAE;gBACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC7B;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAAC,OAAe;QAChD,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACJ;AA7CD,sCA6CC"}
|
|
@@ -14,12 +14,14 @@ class RetornoComando {
|
|
|
14
14
|
this.ultimoId = resultadoExecucao.lastID;
|
|
15
15
|
}
|
|
16
16
|
if (resultadoExecucao.stmt) {
|
|
17
|
+
const linhas = this.linhasAfetadas || 0;
|
|
17
18
|
this.comandoExecutado = resultadoExecucao.stmt;
|
|
18
|
-
this.mensagemExecucao = `Ok (${
|
|
19
|
+
this.mensagemExecucao = `Ok (${linhas} ${linhas > 1 ? 'linhas afetadas' : 'linha afetada'})`;
|
|
19
20
|
}
|
|
20
21
|
if (Array.isArray(resultadoExecucao)) {
|
|
22
|
+
const linhas = this.linhasRetornadas.length || 0;
|
|
21
23
|
this.linhasRetornadas = resultadoExecucao;
|
|
22
|
-
this.mensagemExecucao = `(${
|
|
24
|
+
this.mensagemExecucao = `(${linhas} ${linhas > 1 ? 'linhas retornadas' : 'linha retornada'})`;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retorno-comando.js","sourceRoot":"","sources":["../../../fontes/infraestrutura/retorno-comando.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAOvB,YAAY,iBAAsB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GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,IAAI,CAAC,CAAA;YAChD,IAAI,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;YAC1C,IAAI,CAAC,gBAAgB,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,GAAG,CAAC;SACjG;IACL,CAAC;CACJ;AAhCD,wCAgCC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designliquido/lincones-sqlite",
|
|
3
3
|
"description": "Implementação de LinConEs para SQLite.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Leonel Sanches da Silva",
|
|
7
7
|
"contributors": [
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@types/sqlite3": "^3.1.8",
|
|
62
62
|
"prettier": "^2.8.0",
|
|
63
|
-
"sqlite": "
|
|
63
|
+
"sqlite": "4.1.2",
|
|
64
|
+
"sqlite3": "^5.1.4"
|
|
64
65
|
}
|
|
65
66
|
}
|