vesper
vesper copied to clipboard
Cannot use 'connectionName' and 'connectionOptionsReaderOptions' options together
Hi just start to explore typeorm and vesper. Really great frameworks.
Before I tried Prisma and graphql-yoga, but this is so much cleaner and easier to reason about!
One question, is it possible to use a different typeorm connection
than default
in vesper bootstrap
?
Which was defined in ormconfig.yml
.
For example if I want to use the dev
connection from the following configuration.
dev:
type: "sqlite"
database: "./todomvc.db"
synchronize: true
logging: false
test:
type: "sqlite"
database: "./test/test.db"
synchronize: true
logging: false
dropSchema: true
Ok @pleerock pointed me to the solution:
typeorm: {
connectionName: 'development'
}
I also need to point to the location of the config file as I'm in a monorepo and the standard file solution for typeorm config file doesn't work. I found out you can do that with:
typeorm: {
connectionOptionsReaderOptions: { root: path.join(__dirname, '..') }
}
These both work fine in isolation, however when I want to use both:
typeorm: {
connectionOptionsReaderOptions: { root: path.join(__dirname, '..') },
connectionName: 'development'
}
I get the Connection \"default\" was not found.
error.
hmm try to checkout code and debug
@pleerock did you had a look in #34? Maybe it's related.