Skip to content

Commit

Permalink
chore: fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed Jan 13, 2025
1 parent a9712e1 commit 0fb1712
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions libs/driver-adapters/executor/src/schema-engine-wasm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD:libs/driver-adapters/executor/src/schema-engine-wasm.ts
import fs from 'node:fs/promises'
import path from 'node:path'
import { __dirname, normaliseProvider } from './utils.js'
Expand All @@ -22,30 +21,6 @@ export async function getSchemaEngineForProvider(provider: Queryable['provider']
),
)

=======
import * as wasmPostgres from '../../../../schema-engine/schema-engine-wasm/pkg/postgresql/schema_engine_bg.js'
import * as wasmMysql from '../../../../schema-engine/schema-engine-wasm/pkg/mysql/schema_engine_bg.js'
import * as wasmSqlite from '../../../../schema-engine/schema-engine-wasm/pkg/sqlite/schema_engine_bg.js'
import fs from 'node:fs/promises'
import path from 'node:path'
import { __dirname } from './utils.js'

const wasm = {
postgres: wasmPostgres,
mysql: wasmMysql,
sqlite: wasmSqlite
}

type EngineName = keyof typeof wasm

const initializedModules = new Set<EngineName>()

export async function getSchemaEngineForProvider(provider: EngineName) {
const engine = wasm[provider]
if (!initializedModules.has(provider)) {
const subDir = provider === 'postgres' ? 'postgresql' : provider
const bytes = await fs.readFile(path.resolve(__dirname, '..', '..', '..', '..', 'schema-engine', 'schema-engine-wasm', 'pkg', subDir, 'schema_engine_bg.wasm'))
>>>>>>> main:query-engine/driver-adapters/executor/src/schema-engine-wasm.ts
const module = new WebAssembly.Module(bytes)
const instance = new WebAssembly.Instance(module, { './schema_engine_bg.js': engine })
engine.__wbg_set_wasm(instance.exports)
Expand Down

0 comments on commit 0fb1712

Please sign in to comment.