-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Support specifying different data types per driver on entity columns #2590
Comments
what is the purpose of using two databases in the app? |
Migration and benchmarking. |
I would like deploy the same application in different server that have their own sql-like database.
@pleerock Do you see what I mean ? |
Any news on this topic? |
Additionally, this is required if you run your tests with something like an in-memory |
This would bee nice to support several db for different uses cases like dev/staging/prod +1 |
Any news on this feature? I'd like to use |
I would also like to chime in as I need such thing to support multiple customers with their unique limitations about their internal infrastructure. |
Agree... this would be useful for instance: For local dev environments, it's very convenient to simply package up SQLite with the repo for all devs to use. For staging and production deployments, the environment would be an RDBMS. |
Was this discussion concluded with a solution?... My team recently switched to Typescript (from Java) and now are faced with this constraint. Somehow we never really had to deal with this while using Hibernate with Java. Would be great to figure this out on TypeOrm |
Issue type:
[] question
[ ] bug report
[x ] feature request
[ ] documentation issue
Database system/driver:
[x ]
cordova
[ ]
mongodb
[x ]
mssql
[x ]
mysql
/mariadb
[x ]
oracle
[x ]
postgres
[x ]
sqlite
[x ]
sqljs
[x ]
react-native
[x ]
expo
TypeORM version:
[x ]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
Different databases have varying data types. For example, there is a tinyint in mysql and sqlite but not in postgresql. There needs to be a way to specify different data types for each column/field on the same entity class, so that we don't have different entities for each database type and switch statements for creation, especially when we want to support multiple databases in the same codebase.
E.g. today I do something like this:
Note that I can probably use an interface to get rid of some boilerplate like so:
However, doing it this way would be nicer though:
Maybe I am missing something obvious, or an alternative simpler way to do this, though.
The text was updated successfully, but these errors were encountered: