ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
Steps to reproduce or a small repository showing the problem:
I have two models, with a OneToOne relationship. I have many other relationships in my code similar to this, even other relationships on this model, and they all seem to work fine, except this one. which makes me think I must be missing something small.
The models are Lobby and Game. A Game can be associated to a Lobby, but Game is nullable.
When I do a find query for an array of Lobbies, I get the error:
QueryFailedError: ER_BAD_FIELD_ERROR: Unknown column 'Lobby_game.color1' in 'field list'
at new QueryFailedError (E:\sites\gtoons\server\src\error\QueryFailedError.ts:9:9)
at Query.<anonymous> (E:\sites\gtoons\server\src\driver\mysql\MysqlQueryRunner.ts:167:37)
at Query.<anonymous> (E:\sites\gtoons\server\node_modules\mysql\lib\Connection.js:526:10)
at Query._callback (E:\sites\gtoons\server\node_modules\mysql\lib\Connection.js:488:16)
at Query.Sequence.end (E:\sites\gtoons\server\node_modules\mysql\lib\protocol\sequences\Sequence.js:83:24)
at Query.ErrorPacket (E:\sites\gtoons\server\node_modules\mysql\lib\protocol\sequences\Query.js:92:8)
at Protocol._parsePacket (E:\sites\gtoons\server\node_modules\mysql\lib\protocol\Protocol.js:291:23)
at Parser._parsePacket (E:\sites\gtoons\server\node_modules\mysql\lib\protocol\Parser.js:433:10)
at Parser.write (E:\sites\gtoons\server\node_modules\mysql\lib\protocol\Parser.js:43:10)
at Protocol.write (E:\sites\gtoons\server\node_modules\mysql\lib\protocol\Protocol.js:38:16)
If anyone could maybe point me in the right direction, I would greatly appreciate it.
Here is a screenshot of my lobby table that shows i have the gameId column for the relationship in my lobby table
and also here is a screenshot of my game table that shows all the fields are on the table to match the entity code
If anyone wanted to see other code surrounding the issue, here's a link to the repo and branch this bug is happening in. Please let me know if you have any questions that might illuminate the issue
Issue type:
[x] question [ ] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]mongodb
[x]mssql
[ ]mysql
/mariadb
[ ]oracle
[ ]postgres
[ ]cockroachdb
[ ]sqlite
[ ]sqljs
[ ]react-native
[ ]expo
TypeORM version:
[x]
latest
[ ]@next
[ ]0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
I have two models, with a
OneToOne
relationship. I have many other relationships in my code similar to this, even other relationships on this model, and they all seem to work fine, except this one. which makes me think I must be missing something small.The models are
Lobby
andGame
. A Game can be associated to a Lobby, but Game is nullable.When I do a find query for an array of Lobbies, I get the error:
If anyone could maybe point me in the right direction, I would greatly appreciate it.
controller code that does the query:
Lobby Entity
Game Entity
Here is a screenshot of my lobby table that shows i have the
gameId
column for the relationship in my lobby tableand also here is a screenshot of my game table that shows all the fields are on the table to match the entity code
If anyone wanted to see other code surrounding the issue, here's a link to the repo and branch this bug is happening in. Please let me know if you have any questions that might illuminate the issue
https://github.com/ZakRabe/gtoons/tree/game-logic/server/src/common/entity
This one has really stumped me for a few days, thanks in advance for any help/advice.