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
The deprecated/alias ConnectionOptions
type is no longer exported from typeorm
#8837
Labels
Comments
same problem :
|
Thanks for the report. Please feel free to PR (just add missing export to |
feather-jmalone
added a commit
to feather-jmalone/typeorm
that referenced
this issue
Apr 4, 2022
5 tasks
pleerock
pushed a commit
that referenced
this issue
Apr 4, 2022
i have same issue with mysql n mariadb |
tengo otro problema algunos funcionamientos con el Connection, getConnection, createConnection, ConnectionOptions,, no tiene compatibilidad con la version SDK Expo 48.0, hay otra forma para mantener la libreria TypeOrm? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
Expected Behavior
The
ConnectionOptions
type is@deprecated
as ofv0.3.0
(2022-03-17). TheConnection
type was also marked as@deprecated
in this same version, but both types still have 'alias' types for backwards compatibility's sake. This is accomplished by declaring thatConnectionOptions extends DataSourceOptions
andConnection extends DataSource
, respectively:While it's great that the intent was to be backwards compatible, the problem is that the
ConnectionOptions extends DataSourceOptions
class is broken if you try toimport
it from'typeorm'
, because it's not exported inindex.d.ts
:Actual Behavior
While the
Connection
->DataSource
alias is exported fromindex.d.ts
, theConnectionOptions
->DataSourceOptions
alias is not.The newly renamed types can be imported directly from their class files, if you control the imports at that level. But if you're using NestJS for example (or anything with a TypeORM dependency that hasn't been updated to use the names
DataSource
orDataSourceOptions
yet), the compiler will complain thattypeorm
has no exported type calledConnectionOptions
.The Fix
You can temporarily clear this error by adding the following line to
./node_modules/typeorm/index.d.ts
:But of course, that only solves the problem locally, not for CI/CD or other environments where
npm install
might need to run again.[Plus I'm not sure that will completely solve the problem -- the Changelog makes it sound like
DataSource
andDataSourceOptions
are simply just new names forConnection
andConnectionOptions
, but is that definitely true? Does the behavior differ at all?]Steps to Reproduce
Try to initialize a connection using
ConnectionOptions
with a 3rd party library like NestJS, or any other package that has not updated its TypeORM connection code since the release ofv0.3.0
(2022-03-17)My Environment
11.5.2
14.19.1
4.6.2
0.3.4
Additional Context
N/A
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
NOTE: The above simply means that
mysql
is the only driver I tried, not that it was the only that had this issue`Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: