Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename surrealdb.js to surrealdb #53

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -100,7 +100,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 @@ -59,7 +59,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.20",
"testcontainers": "^10.11.0",
"zod": "^3.23.8"
},
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 { GenericContainer, StartedTestContainer, Wait } from 'testcontainers'

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 @@ -98,7 +98,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) {
Expand Down