arkormx 2.0.0-next.0 → 2.0.0-next.10
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 +42 -13
- package/dist/cli.mjs +790 -276
- package/dist/index.cjs +5956 -3679
- package/dist/index.d.cts +704 -112
- package/dist/index.d.mts +704 -112
- package/dist/index.mjs +6618 -4372
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
[](https://github.com/arkstack-hq/arkormx/actions/workflows/deploy-docs.yml)
|
|
8
8
|
[](https://codecov.io/gh/arkstack-hq/arkormx)
|
|
9
9
|
|
|
10
|
-
Arkormˣ is a framework-agnostic ORM designed to run anywhere Node.js runs. It brings a familiar model layer and fluent query builder on top of
|
|
10
|
+
Arkormˣ is a framework-agnostic ORM designed to run anywhere Node.js runs. It brings a familiar model layer and fluent query builder on top of adapter-backed execution, with Prisma compatibility kept during the current transition window.
|
|
11
11
|
|
|
12
12
|
## Features
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
14
|
+
- Adapter-backed query execution with practical ORM ergonomics.
|
|
15
|
+
- Adapter-first runtime setup with Kysely/Postgres support and a Prisma compatibility adapter during migration.
|
|
16
16
|
- End-to-end guides for setup, querying, relationships, migrations, and CLI usage.
|
|
17
17
|
- Full TypeScript support, providing strong typing and improved developer experience.
|
|
18
18
|
- Follows best practices for security, ensuring your data is protected.
|
|
@@ -26,27 +26,49 @@ Arkormˣ is a framework-agnostic ORM designed to run anywhere Node.js runs. It b
|
|
|
26
26
|
Stable release:
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
pnpm add arkormx
|
|
30
|
-
pnpm add -D prisma
|
|
29
|
+
pnpm add arkormx kysely pg
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
Preview release (`next`):
|
|
34
33
|
|
|
35
34
|
```sh
|
|
36
|
-
pnpm add arkormx@next
|
|
37
|
-
pnpm add -D prisma
|
|
35
|
+
pnpm add arkormx@next kysely pg
|
|
38
36
|
```
|
|
39
37
|
|
|
40
38
|
### Configuration
|
|
41
39
|
|
|
40
|
+
Primary runtime path:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { createKyselyAdapter, defineConfig } from 'arkormx';
|
|
44
|
+
import { Kysely, PostgresDialect } from 'kysely';
|
|
45
|
+
import { Pool } from 'pg';
|
|
46
|
+
|
|
47
|
+
export default defineConfig({
|
|
48
|
+
adapter: createKyselyAdapter(
|
|
49
|
+
new Kysely<Record<string, never>>({
|
|
50
|
+
dialect: new PostgresDialect({
|
|
51
|
+
pool: new Pool({
|
|
52
|
+
connectionString: process.env.DATABASE_URL,
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
}),
|
|
56
|
+
),
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Optional compatibility/runtime config for CLI and transaction helpers:
|
|
61
|
+
|
|
42
62
|
Create `arkormx.config.js` in your project root:
|
|
43
63
|
|
|
44
64
|
```ts
|
|
45
65
|
import { defineConfig } from 'arkormx';
|
|
46
66
|
import { PrismaClient } from '@prisma/client';
|
|
47
67
|
|
|
68
|
+
const prisma = new PrismaClient();
|
|
69
|
+
|
|
48
70
|
export default defineConfig({
|
|
49
|
-
prisma:
|
|
71
|
+
prisma: () => prisma,
|
|
50
72
|
});
|
|
51
73
|
```
|
|
52
74
|
|
|
@@ -57,15 +79,21 @@ Or run the Arkormˣ CLI command `npx arkorm init` to initialize your project alo
|
|
|
57
79
|
```ts
|
|
58
80
|
import { Model } from 'arkormx';
|
|
59
81
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
type UserAttributes = {
|
|
83
|
+
id: number;
|
|
84
|
+
email: string;
|
|
85
|
+
name: string;
|
|
86
|
+
isActive: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export class User extends Model<UserAttributes> {}
|
|
63
90
|
```
|
|
64
91
|
|
|
65
|
-
###
|
|
92
|
+
### Optional Prisma compatibility
|
|
66
93
|
|
|
67
94
|
```sh
|
|
68
|
-
pnpm prisma
|
|
95
|
+
pnpm add @prisma/client
|
|
96
|
+
pnpm add -D prisma
|
|
69
97
|
```
|
|
70
98
|
|
|
71
99
|
### Run queries
|
|
@@ -98,6 +126,7 @@ await User.transaction(async () => {
|
|
|
98
126
|
|
|
99
127
|
- [Setup](https://arkormx.toneflix.net/guide/setup)
|
|
100
128
|
- [Configuration](https://arkormx.dev/guide/configuration)
|
|
129
|
+
- [Prisma Compatibility](https://arkormx.dev/guide/prisma-compatibility)
|
|
101
130
|
- [Typing](https://arkormx.dev/guide/typing)
|
|
102
131
|
- [Models](https://arkormx.dev/guide/models)
|
|
103
132
|
- [Query Builder](https://arkormx.dev/guide/query-builder)
|