Skip to content

Commit 038758c

Browse files
committed
chore(npm): update dependencies
1 parent 7194802 commit 038758c

19 files changed

+903
-585
lines changed

package-lock.json

+772-488
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/database",
3-
"version": "5.9.0",
3+
"version": "5.10.0",
44
"description": "The Athenna database handler for SQL/NoSQL.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",
@@ -76,18 +76,18 @@
7676
"fast-deep-equal": "^3.1.3"
7777
},
7878
"devDependencies": {
79-
"@athenna/artisan": "^5.3.0",
80-
"@athenna/common": "^5.3.0",
81-
"@athenna/config": "^5.1.0",
82-
"@athenna/ioc": "^5.0.0",
83-
"@athenna/logger": "^5.1.0",
84-
"@athenna/test": "^5.2.0",
79+
"@athenna/artisan": "^5.6.0",
80+
"@athenna/common": "^5.7.0",
81+
"@athenna/config": "^5.3.0",
82+
"@athenna/ioc": "^5.1.0",
83+
"@athenna/logger": "^5.3.0",
84+
"@athenna/test": "^5.3.0",
8585
"@athenna/tsconfig": "^5.0.0",
86-
"@athenna/view": "^5.1.0",
86+
"@athenna/view": "^5.3.0",
8787
"@types/knex": "^0.16.1",
8888
"@types/mongoose": "^5.11.97",
89-
"@typescript-eslint/eslint-plugin": "^7.18.0",
90-
"@typescript-eslint/parser": "^7.18.0",
89+
"@typescript-eslint/eslint-plugin": "^8.21.0",
90+
"@typescript-eslint/parser": "^8.21.0",
9191
"better-sqlite3": "^9.6.0",
9292
"commitizen": "^4.3.1",
9393
"cz-conventional-changelog": "^3.3.0",
@@ -101,7 +101,7 @@
101101
"husky": "^3.1.0",
102102
"lint-staged": "^12.5.0",
103103
"mongodb-memory-server": "^9.5.0",
104-
"mongoose": "^7.8.3",
104+
"mongoose": "^8.9.5",
105105
"mysql2": "^3.12.0",
106106
"pg": "^8.13.1",
107107
"prettier": "^2.8.8"

src/commands/DbSeedCommand.ts

-18
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import { Exec } from '@athenna/common'
1110
import { Database } from '#src/facades/Database'
1211
import { BaseCommand, Option } from '@athenna/artisan'
1312

@@ -40,12 +39,6 @@ export class DbSeedCommand extends BaseCommand {
4039
const task = this.logger.task()
4140
const DB = Database.connection(this.connection)
4241

43-
if (this.getConfig('driver') === 'mongo') {
44-
task.addPromise('Connecting to database', () => {
45-
return Exec.sleep(5000)
46-
})
47-
}
48-
4942
await DB.runSeeders({ task, classes: this.classes })
5043

5144
await task
@@ -59,15 +52,4 @@ export class DbSeedCommand extends BaseCommand {
5952
})
6053
.finally(() => DB.close())
6154
}
62-
63-
private getConfig(name: string, defaultValue?: any) {
64-
return Config.get(
65-
`database.connections.${
66-
this.connection === 'default'
67-
? Config.get('database.default')
68-
: this.connection
69-
}.${name}`,
70-
defaultValue
71-
)
72-
}
7355
}

src/commands/DbWipeCommand.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import { Exec } from '@athenna/common'
1110
import { Database } from '#src/facades/Database'
1211
import { BaseCommand, Option } from '@athenna/artisan'
1312

@@ -34,14 +33,10 @@ export class DbWipeCommand extends BaseCommand {
3433
const DB = Database.connection(this.connection)
3534

3635
if (this.getConfig('driver') === 'mongo') {
37-
task.addPromise('Connecting to database', () => {
38-
return Exec.sleep(5000)
39-
})
40-
4136
task.addPromise('Dropping all database tables', async () => {
4237
const tables = await DB.getTables()
4338

44-
return Exec.concurrently(tables, table => DB.dropTable(table))
39+
return tables.athenna.concurrently(table => DB.dropTable(table))
4540
})
4641
} else {
4742
const migrationsTable = this.getConfig(

src/database/DatabaseImpl.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
*/
99

1010
import type { Knex } from 'knex'
11-
import { Path, Module, Options } from '@athenna/common'
1211
import type { Connections, ConnectionOptions } from '#src/types'
1312
import type { FakeDriver } from '#src/database/drivers/FakeDriver'
1413
import { QueryBuilder } from '#src/database/builders/QueryBuilder'
14+
import { Path, Module, Options, Macroable } from '@athenna/common'
1515
import { ConnectionFactory } from '#src/factories/ConnectionFactory'
1616
import type { MongoDriver } from '#src/database/drivers/MongoDriver'
1717
import type { MySqlDriver } from '#src/database/drivers/MySqlDriver'
@@ -20,7 +20,7 @@ import type { Driver as DriverImpl } from '#src/database/drivers/Driver'
2020
import type { Transaction } from '#src/database/transactions/Transaction'
2121
import type { PostgresDriver } from '#src/database/drivers/PostgresDriver'
2222

23-
export class DatabaseImpl<Driver extends DriverImpl = any> {
23+
export class DatabaseImpl<Driver extends DriverImpl = any> extends Macroable {
2424
/**
2525
* The connection name used for this instance.
2626
*/
@@ -35,6 +35,8 @@ export class DatabaseImpl<Driver extends DriverImpl = any> {
3535
* Creates a new instance of DatabaseImpl.
3636
*/
3737
public constructor(athennaDbOpts?: ConnectionOptions) {
38+
super()
39+
3840
this.driver = ConnectionFactory.fabricate(
3941
this.connectionName
4042
) as unknown as Driver

src/database/builders/QueryBuilder.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import type {
11-
Collection,
12-
PaginatedResponse,
13-
PaginationOptions
10+
import {
11+
Macroable,
12+
type Collection,
13+
type PaginatedResponse,
14+
type PaginationOptions
1415
} from '@athenna/common'
1516
import type { Operations } from '#src/types/Operations'
1617
import type { Direction, ModelColumns } from '#src/types'
1718
import type { Driver as DriverImpl } from '#src/database/drivers/Driver'
1819

19-
export class QueryBuilder<T = any, Driver extends DriverImpl = any> {
20+
export class QueryBuilder<
21+
T = any,
22+
Driver extends DriverImpl = any
23+
> extends Macroable {
2024
/**
2125
* The drivers responsible for handling database operations.
2226
*/
@@ -26,6 +30,7 @@ export class QueryBuilder<T = any, Driver extends DriverImpl = any> {
2630
* Creates a new instance of QueryBuilder.
2731
*/
2832
public constructor(driver: Driver, tableName: string) {
33+
super()
2934
this.driver = driver
3035
this.driver.table(tableName)
3136
}

0 commit comments

Comments
 (0)