@xata.io/drizzle 0.0.0-alpha.vb6d5748 → 0.0.0-alpha.vf5fbc45

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @xata.io/drizzle@0.0.1 build /home/runner/work/client-ts/client-ts/packages/plugin-client-drizzle
2
+ > @xata.io/drizzle@0.0.0 build /home/runner/work/client-ts/client-ts/packages/plugin-client-drizzle
3
3
  > rimraf dist && rollup -c
4
4
 
5
5
  
@@ -8,7 +8,7 @@
8
8
  https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
9
9
  drizzle-orm (imported by "src/driver.ts", "src/session.ts" and "src/utils.ts")
10
10
  drizzle-orm/pg-core (imported by "src/driver.ts", "src/session.ts" and "src/generate.ts")
11
- created dist/index.cjs, dist/index.mjs in 854ms
11
+ created dist/index.cjs, dist/index.mjs in 980ms
12
12
  
13
13
  src/index.ts → dist/index.d.ts...
14
- created dist/index.d.ts in 12.3s
14
+ created dist/index.d.ts in 14.4s
package/CHANGELOG.md CHANGED
@@ -1,17 +1,10 @@
1
1
  # @xata.io/drizzle
2
2
 
3
- ## 0.0.0-alpha.vb6d5748
3
+ ## 0.0.0-alpha.vf5fbc45
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies []:
8
- - @xata.io/client@0.0.0-alpha.vb6d5748
9
-
10
- ## 0.0.1
11
-
12
- ### Patch Changes
13
-
14
- - [#1145](https://github.com/xataio/client-ts/pull/1145) [`e41d7faf`](https://github.com/xataio/client-ts/commit/e41d7faf40747fd31a08cdcd767d9596f88e4a20) Thanks [@SferaDev](https://github.com/SferaDev)! - Initial release
7
+ - [#1145](https://github.com/xataio/client-ts/pull/1145) [`6934686c`](https://github.com/xataio/client-ts/commit/6934686cd7102d09d29deaf948c497f27cfdda87) Thanks [@SferaDev](https://github.com/SferaDev)! - Initial release
15
8
 
16
9
  - Updated dependencies [[`22fccb51`](https://github.com/xataio/client-ts/commit/22fccb51709749c319897702c15749b74ce4b820)]:
17
- - @xata.io/client@0.26.2
10
+ - @xata.io/client@0.0.0-alpha.vf5fbc45
package/README.md CHANGED
@@ -24,47 +24,33 @@ npm install drizzle-orm @xata.io/drizzle @xata.io/client
24
24
  To work with drizzle you need to define your models and then create a drizzle instance with the models.
25
25
 
26
26
  ```ts
27
- import { drizzle } from '@xata.io/drizzle';
28
- import { sql } from 'drizzle-orm';
29
27
  import { pgTable, text } from 'drizzle-orm/pg-core';
28
+ import { drizzle } from '@xata.io/drizzle';
30
29
  import { getXataClient } from './xata';
31
30
 
32
31
  const xata = getXataClient();
32
+ const db = drizzle(xata);
33
33
 
34
34
  const drivers = pgTable('drivers', {
35
35
  id: text('id').primaryKey(),
36
36
  surname: text('surname'),
37
- forename: text('forename'),
38
- nationality: text('nationality')
37
+ forename: text('forename')
39
38
  });
40
39
 
41
- const schema = {
42
- drivers
43
- };
44
-
45
- const db = drizzle(xata, { schema });
46
-
47
- const result = await db.execute(sql`select * from ${drivers} where ${drivers.nationality} = 'Spanish'`);
40
+ const result = await db.select().from(drivers).execute();
48
41
  ```
49
42
 
50
43
  ## [Experimental] Model generation
51
44
 
52
- We offer an experimental model generation helper that will generate the models for you from your `tables` array in your `xata.ts` file. Since it's a work in progress, we don't recommend using it in your applications yet, please build your models manually. However, we would love to hear your feedback on it.
45
+ We offer an experimental model generation helper that will generate the models for you from your `tables` array in your `xata.ts` file. Since it's a work in progress, we don't recommend using it in production yet, please build your models manually.
53
46
 
54
47
  ```ts
55
- import { drizzle, buildModels } from '@xata.io/drizzle';
56
- import { sql } from 'drizzle-orm';
57
- import { pgTable, text } from 'drizzle-orm/pg-core';
58
- import { getXataClient, tables } from './xata';
59
-
60
- const xata = getXataClient();
61
-
62
- const schema = buildModels(tables);
63
- const { drivers } = schema;
48
+ import { buildModels } from '@xata.io/drizzle';
49
+ import { tables } from './xata';
64
50
 
65
- const db = drizzle(xata, { schema });
51
+ const { drivers } = buildModels(tables);
66
52
 
67
- const result = await db.execute(sql`select * from ${drivers} where ${drivers.nationality} = 'Spanish'`);
53
+ const result = await db.select().from(drivers).execute();
68
54
  ```
69
55
 
70
56
  ## Limitations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xata.io/drizzle",
3
- "version": "0.0.0-alpha.vb6d5748",
3
+ "version": "0.0.0-alpha.vf5fbc45",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -18,7 +18,7 @@
18
18
  "url": "https://github.com/xataio/client-ts/issues"
19
19
  },
20
20
  "dependencies": {
21
- "@xata.io/client": "0.0.0-alpha.vb6d5748"
21
+ "@xata.io/client": "0.0.0-alpha.vf5fbc45"
22
22
  },
23
23
  "devDependencies": {
24
24
  "drizzle-orm": "^0.28.5"