Skip to content

Commit 27960a4

Browse files
committed
chore: use memory sqlite
1 parent ab25ca8 commit 27960a4

File tree

5 files changed

+49
-21
lines changed

5 files changed

+49
-21
lines changed

docs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ brinedb / [Exports](modules.md)
44

55
# BrineDB
66

7-
[SeaORM](https://www.sea-ql.org/SeaORM/) wrapper for NodeJS, providing basic key/value storage in SQLite/Postgres/MySQL
7+
[SeaORM](https://www.sea-ql.org/SeaORM/) wrapper for NodeJS, providing basic key/value storage in SQLite/Postgres/MySQL/MariaDB.
88

99
## Table of contents
1010

@@ -51,6 +51,9 @@ const brinedb = new Brine('sqlite:/path/to/database.sqlite');
5151
// Postgres
5252
const brinedb = new Brine('postgres://user:pass@localhost:5432/dbname');
5353

54+
// MariaDB
55+
const brinedb = new Brine('mariadb://user:pass@localhost:3306/dbname');
56+
5457
// MySQL
5558
const brinedb = new Brine('mysql://user:pass@localhost:3306/dbname');
5659

docs/classes/Brine.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const value = await brine.get("key");
4343
### Methods
4444

4545
- [clear](Brine.md#clear)
46+
- [close](Brine.md#close)
4647
- [count](Brine.md#count)
4748
- [delete](Brine.md#delete)
4849
- [deleteMany](Brine.md#deletemany)
@@ -80,7 +81,7 @@ Create a new Brine instance
8081

8182
#### Defined in
8283

83-
[index.ts:50](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L50)
84+
[index.ts:50](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L50)
8485

8586
## Properties
8687

@@ -90,7 +91,7 @@ Create a new Brine instance
9091

9192
#### Defined in
9293

93-
[index.ts:37](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L37)
94+
[index.ts:37](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L37)
9495

9596
___
9697

@@ -114,7 +115,7 @@ ___
114115

115116
#### Defined in
116117

117-
[index.ts:41](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L41)
118+
[index.ts:41](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L41)
118119

119120
___
120121

@@ -124,7 +125,7 @@ ___
124125

125126
#### Defined in
126127

127-
[index.ts:39](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L39)
128+
[index.ts:39](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L39)
128129

129130
___
130131

@@ -148,7 +149,7 @@ ___
148149

149150
#### Defined in
150151

151-
[index.ts:42](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L42)
152+
[index.ts:42](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L42)
152153

153154
## Accessors
154155

@@ -162,7 +163,7 @@ ___
162163

163164
#### Defined in
164165

165-
[index.ts:62](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L62)
166+
[index.ts:62](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L62)
166167

167168
## Methods
168169

@@ -186,7 +187,31 @@ await brinedb.clear();
186187

187188
#### Defined in
188189

189-
[index.ts:136](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L136)
190+
[index.ts:136](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L136)
191+
192+
___
193+
194+
### close
195+
196+
**close**(): `Promise`\<`void`\>
197+
198+
Close the connection to the database
199+
200+
#### Returns
201+
202+
`Promise`\<`void`\>
203+
204+
Promise<void>
205+
206+
**`Example`**
207+
208+
```ts
209+
await brinedb.close();
210+
```
211+
212+
#### Defined in
213+
214+
[index.ts:240](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L240)
190215

191216
___
192217

@@ -210,7 +235,7 @@ const count = await brinedb.count();
210235

211236
#### Defined in
212237

213-
[index.ts:180](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L180)
238+
[index.ts:180](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L180)
214239

215240
___
216241

@@ -240,7 +265,7 @@ await brinedb.delete("key");
240265

241266
#### Defined in
242267

243-
[index.ts:151](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L151)
268+
[index.ts:151](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L151)
244269

245270
___
246271

@@ -270,7 +295,7 @@ await brinedb.deleteMany(["key1", "key2"]);
270295

271296
#### Defined in
272297

273-
[index.ts:166](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L166)
298+
[index.ts:166](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L166)
274299

275300
___
276301

@@ -307,7 +332,7 @@ changed === "value"; // true
307332

308333
#### Defined in
309334

310-
[index.ts:204](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L204)
335+
[index.ts:204](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L204)
311336

312337
___
313338

@@ -337,7 +362,7 @@ const value = await brinedb.get("key");
337362

338363
#### Defined in
339364

340-
[index.ts:95](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L95)
365+
[index.ts:95](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L95)
341366

342367
___
343368

@@ -367,7 +392,7 @@ const exists = await brinedb.has("key");
367392

368393
#### Defined in
369394

370-
[index.ts:224](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L224)
395+
[index.ts:224](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L224)
371396

372397
___
373398

@@ -391,7 +416,7 @@ await brinedb.init();
391416

392417
#### Defined in
393418

394-
[index.ts:78](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L78)
419+
[index.ts:78](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L78)
395420

396421
___
397422

@@ -405,7 +430,7 @@ ___
405430

406431
#### Defined in
407432

408-
[index.ts:230](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L230)
433+
[index.ts:248](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L248)
409434

410435
___
411436

@@ -437,4 +462,4 @@ await brinedb.set("key", "value");
437462

438463
#### Defined in
439464

440-
[index.ts:118](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L118)
465+
[index.ts:118](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L118)

docs/interfaces/BrineOptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ JSON.parse
4545

4646
#### Defined in
4747

48-
[index.ts:18](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L18)
48+
[index.ts:18](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L18)
4949

5050
___
5151

@@ -77,4 +77,4 @@ JSON.stringify
7777

7878
#### Defined in
7979

80-
[index.ts:11](https://github.com/dan-online/brinedb/blob/1f98f0b/src/index.ts#L11)
80+
[index.ts:11](https://github.com/dan-online/brinedb/blob/ab25ca8/src/index.ts#L11)

docs/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Renames and re-exports [Brine](classes/Brine.md)
4646

4747
#### Defined in
4848

49-
[utils.ts:1](https://github.com/dan-online/brinedb/blob/1f98f0b/src/utils.ts#L1)
49+
[utils.ts:1](https://github.com/dan-online/brinedb/blob/ab25ca8/src/utils.ts#L1)

tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe("Test suite", () => {
55
let brine: Brine;
66

77
test("can instantiate", async () => {
8-
brine = new Brine("mysql://root:root@localhost:3306/brine");
8+
brine = new Brine(BrineDatabases.sqlite.memory);
99
});
1010

1111
test("can initialize", async () => {

0 commit comments

Comments
 (0)