Quick fix, make sure auto-columns never sent to DB.
This commit is contained in:
parent
3cdd658ea0
commit
6648e548c5
|
@ -162,7 +162,7 @@ module External {
|
||||||
manyRelationships: ManyRelationship[] = []
|
manyRelationships: ManyRelationship[] = []
|
||||||
for (let [key, field] of Object.entries(table.schema)) {
|
for (let [key, field] of Object.entries(table.schema)) {
|
||||||
// if set already, or not set just skip it
|
// if set already, or not set just skip it
|
||||||
if (!row[key] || newRow[key]) {
|
if (!row[key] || newRow[key] || field.autocolumn) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// if its not a link then just copy it over
|
// if its not a link then just copy it over
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe("Postgres Integration", () => {
|
||||||
|
|
||||||
it("calls the create method with the correct params", async () => {
|
it("calls the create method with the correct params", async () => {
|
||||||
const sql = "insert into users (name, age) values ('Joe', 123);"
|
const sql = "insert into users (name, age) values ('Joe', 123);"
|
||||||
const response = await config.integration.create({
|
await config.integration.create({
|
||||||
sql
|
sql
|
||||||
})
|
})
|
||||||
expect(pg.queryMock).toHaveBeenCalledWith(sql, {})
|
expect(pg.queryMock).toHaveBeenCalledWith(sql, {})
|
||||||
|
@ -25,7 +25,7 @@ describe("Postgres Integration", () => {
|
||||||
|
|
||||||
it("calls the read method with the correct params", async () => {
|
it("calls the read method with the correct params", async () => {
|
||||||
const sql = "select * from users;"
|
const sql = "select * from users;"
|
||||||
const response = await config.integration.read({
|
await config.integration.read({
|
||||||
sql
|
sql
|
||||||
})
|
})
|
||||||
expect(pg.queryMock).toHaveBeenCalledWith(sql, {})
|
expect(pg.queryMock).toHaveBeenCalledWith(sql, {})
|
||||||
|
|
Loading…
Reference in New Issue