Support any column type for SQL.js?
See original GitHub issueHi there! We’re using sql.js
to run our unit tests against our code, and this is actually very convenient (as it allows us doing this even if PgSQL is not available/running on the machine). The best approach would actually be to mock the Connection and its repositories (instead of using an in-mem db), but I did not look for a clean way to do it yet…
However…
Issue type:
[ ] question [ ] bug report [x] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[x] sqljs
[ ] websql
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
Connect to a database with type
being “sql.js” and with entities
containing an entity with a @Column of type
“timestamp”.
We can see in many places that SQLite should be able to support any type (including timestamp, also here), as stated in the documentation of the v2), If SQL.js is a port of SQLite, and SQLite is “typeless”, should TypeORM accepts any type for the columns of the entities given to a sql.js database?
At the current time, this is what we get when running our unit tests:
DataTypeNotSupportedError: Data type “timestamp” in “EntityName.createdAt” is not supported by “sqljs” database.
Thanks for this beautiful project!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
@VinceOPS I think it would be great to have a page in our documentation about “How to do testing” with TypeORM, where we provide information about all user cases and what tools we provide to solve their testing problems. It can be a good start point for us to provide all necessary testing infrastructure for users if we start with list of problems user face when he write test for apps using typeorm.
Maybe its a better idea to create a separate driver type specially for testing purpose? Which can be based on sqljs