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

Bug: ctx.database always be undefined #82

Closed
Seidko opened this issue Apr 13, 2024 · 0 comments
Closed

Bug: ctx.database always be undefined #82

Seidko opened this issue Apr 13, 2024 · 0 comments

Comments

@Seidko
Copy link
Contributor

Seidko commented Apr 13, 2024

description

code:

import { Context } from 'cordis'
import SQLite from '@minatojs/driver-sqlite'
import Database from 'minato'

function apply(ctx: Context) {
  // ctx.database always be undefined
  console.log(ctx.database.drivers.default.config)
}
apply.inject = ['database']

const ctx = new Context()
ctx.plugin(Database)
ctx.plugin(SQLite, {
  path: './test.db'
})
ctx.plugin(apply)


await ctx.start()
@shigma shigma closed this as completed in 2f1f990 Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant