Skip to content

Commit

Permalink
test(playground): adjusted playground to import from @mikro-orm/knex …
Browse files Browse the repository at this point in the history
…to trigger errors during dev
  • Loading branch information
boenrobot committed May 28, 2024
1 parent 337b046 commit 82134e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
2 changes: 1 addition & 1 deletion playground/components/DbLog.server.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script setup lang="ts">
import { type EntityManager } from "@mikro-orm/mysql";
import { type EntityManager } from "@mikro-orm/knex";
const event = useRequestEvent()!;
const em = useEntityManager<EntityManager>(event);
Expand Down
28 changes: 0 additions & 28 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,4 @@ export default defineNuxtConfig({
devtools: {
enabled: true,
},
vite: {
optimizeDeps: {
exclude: [
'@mikro-orm/better-sqlite',
'@mikro-orm/migrations',
'@mikro-orm/entity-generator',
'@mikro-orm/mariadb',
'@mikro-orm/mariadb',
'@mikro-orm/mongodb',
//'@mikro-orm/mysql',
'@mikro-orm/postgresql',
'@mikro-orm/seeder',
'@mikro-orm/sqlite',
'@vscode/sqlite3',
'sqlite3',
'better-sqlite3',
//'mysql',
//'mysql2',
'oracledb',
'pg',
'pg-native',
'pg-query-stream',
'tedious',
'libsql',
'mariadb/callback',
],
},
}
})
4 changes: 2 additions & 2 deletions playground/server/plugins/00.mikroOrmConfigProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { initOrm } from "#imports";
import { defineConfig, type EntityManager, type MikroORM } from "@mikro-orm/mysql";
import { defineConfig, type MikroORM } from "@mikro-orm/mysql";

export default defineNitroPlugin(async (_nitro) => {
const orm = await initOrm<MikroORM>(defineConfig({
Expand All @@ -14,7 +14,7 @@ export default defineNitroPlugin(async (_nitro) => {
}));

await orm.schema.ensureDatabase({create: true});
const em = orm.em as EntityManager;
const em = orm.em;
await em.execute(`
CREATE TABLE IF NOT EXISTS \`products\`
(
Expand Down

0 comments on commit 82134e3

Please sign in to comment.