Repository navigation
Conversation
…t and overrid postgres helpers for cockroachDB
| constructor() { | ||
| super(); | ||
|
|
||
| this.model.findOrCreate = async options => { |
There was a problem hiding this comment.
You can't modify a model method dynamically like this. Instead, I recommend modifying findOrCreate and findByPk in model.js to support your use case
There was a problem hiding this comment.
Thanks for the nudge. This has been helpful! I'll make sure to make the changes.
| @@ -0,0 +1,7 @@ | |||
| import * as DataTypes from '../postgres/data-types'; | |||
|
|
|||
| DataTypes.GEOGRAPHY.prototype.getBindParamSql = (value, options): string => { | |||
There was a problem hiding this comment.
You can't modify another dialect like this
You should either:
- make your changes in the postgres data type itself if it's compatible
- or extend that DataType and replace the method
| // const __loadDialectModule = super._loadDialectModule; | ||
| this._loadDialectModule = (...args) => { | ||
| const pg: any = __loadDialectModule(...args); | ||
| pg.types.setTypeParser(20, (val: any) => { |
There was a problem hiding this comment.
Same here you can't make changes that would impact other dialects if yours is running, as users can run multiple instances of Sequelize with different databases
oid 20 is _int8, which should always be returned as a string (for now), not sometimes a string and sometimes a number. We'll eventually change that to use js bigints, but until we do it should remain as a string
…file, addressed some review comments
|
Warning This pull request has been automatically converted to draft because it is not ready to be merged. Reason(s):
Once you have addressed the issue(s) above, you may |
Pull Request Checklist
Description Of Change
Todos