Skip to content

Commit

Permalink
rename surrealdb.js to surrealdb
Browse files Browse the repository at this point in the history
  • Loading branch information
zvictor authored Aug 12, 2024
1 parent d4c5d85 commit 22a8e98
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
## 🚨 Warning Version 2.x

Version 2 has breaking changes!
The tool now uses `surrealdb.js` instead of `surrealdb.node` for interacting with a SurrealDB instance.
The tool now uses `surrealdb` instead of `surrealdb.node` for interacting with a SurrealDB instance.

The change was made, because it seems that `surrealdb.js` is closer to the SurrealDB development process and more up to date in general.
The change was made, because it seems that `surrealdb` is closer to the SurrealDB development process and more up to date in general.

This means, the option "memory" for connections is no longer available, and you need to run against a real running SurrealDB instance (use docker).

Expand Down Expand Up @@ -95,7 +95,7 @@ Example:
"db": "my_database",
"outputFolder": "./out",
"generateClient": true,
"lib": "surrealdb.js"
"lib": "surrealdb"
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"commander": "^12.1.0",
"mkdirp": "^3.0.1",
"rimraf": "^6.0.0",
"surrealdb.js": "^1.0.0-beta.9",
"surrealdb": "^1.0.0-beta.19",
"zod": "^3.23.8"
},
"tshy": {
Expand Down
2 changes: 1 addition & 1 deletion src/database/db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Surreal } from 'surrealdb.js'
import { Surreal } from 'surrealdb'

import type { Config } from '../config/types.js'

Expand Down
2 changes: 1 addition & 1 deletion src/genSchema/ensureRecordSchema.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RecordId, StringRecordId } from 'surrealdb.js'
import { RecordId, StringRecordId } from 'surrealdb'
import { describe, expect, test } from 'vitest'
import z from 'zod'

Expand Down
2 changes: 1 addition & 1 deletion src/genSchema/ensureRecordSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mkdirp } from 'mkdirp'

export const ensureRecordSchema = async (rootPath: string) => {
const content = `import z from 'zod';
import { RecordId, StringRecordId } from 'surrealdb.js'
import { RecordId, StringRecordId } from 'surrealdb'
type TableRecordId<T extends string> = RecordId<T> | StringRecordId | \`\${T}:\${string}\`;
Expand Down
2 changes: 1 addition & 1 deletion src/genSchema/generateTableSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const ${tableName}Schema = ${tableName}OutputSchemaGen.merge(z.object({
const typeFileContent = `/* Place your custom changes here */
import { z } from "zod";
import { type RecordId} from "surrealdb.js";
import { type RecordId} from "surrealdb";
import { ${tableName}CreateSchema, ${tableName}Schema } from "./${tableName}Schema.js";
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const main = async () => {
await generateTableSchema(resolve(__dirname, config.outputFolder), tableInfo)

if (config.generateClient) {
await generateClientJs(resolve(__dirname, config.outputFolder), Object.keys(tableInfo), 'surrealdb.js')
await generateClientJs(resolve(__dirname, config.outputFolder), Object.keys(tableInfo), 'surrealdb')
}
} catch (error) {
printSorry(error)
Expand Down

0 comments on commit 22a8e98

Please sign in to comment.