@arkstack/database 0.16.3 → 0.16.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/database",
3
- "version": "0.16.3",
3
+ "version": "0.16.5",
4
4
  "type": "module",
5
5
  "description": "Database module for Arkstack, providing core database integration and data layer features.",
6
6
  "homepage": "https://arkstack.toneflix.net",
@@ -23,7 +23,8 @@
23
23
  "h3ravel"
24
24
  ],
25
25
  "files": [
26
- "dist"
26
+ "dist",
27
+ "stubs"
27
28
  ],
28
29
  "publishConfig": {
29
30
  "access": "public"
@@ -54,8 +55,8 @@
54
55
  "kysely": "^0.29.2",
55
56
  "pg": "^8.22.0",
56
57
  "resora": "^1.3.27",
57
- "@arkstack/common": "^0.16.3",
58
- "@arkstack/contract": "^0.16.3"
58
+ "@arkstack/common": "^0.16.5",
59
+ "@arkstack/contract": "^0.16.5"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@types/pg": "^8.16.0"
@@ -0,0 +1,31 @@
1
+ import { DatabaseConfig } from '@arkstack/database'
2
+
3
+ export default (): DatabaseConfig => {
4
+ return {
5
+ /**
6
+ * Default Database Connection
7
+ *
8
+ * The connection used whenever one is not explicitly requested.
9
+ * Supported drivers: postgres.
10
+ */
11
+ default: env('DB_CONNECTION', 'pgsql'),
12
+
13
+ /**
14
+ * Database Connections
15
+ *
16
+ * Credentials are provided as discrete fields. When `url` (or
17
+ * `DATABASE_URL`) is set it takes precedence over the discrete fields.
18
+ */
19
+ connections: {
20
+ pgsql: {
21
+ driver: 'postgres',
22
+ url: env('DATABASE_URL'),
23
+ host: env('DB_HOST', '127.0.0.1'),
24
+ port: env('DB_PORT', 5432),
25
+ user: env('DB_USERNAME', 'postgres'),
26
+ database: env('DB_DATABASE', 'arkstack'),
27
+ password: env('DB_PASSWORD', 'postgres'),
28
+ },
29
+ },
30
+ }
31
+ }