Skip to content

Commit

Permalink
chore(core-database-postgres): convert BYTEA to/from string (#3058)
Browse files Browse the repository at this point in the history
* chore(core-database-postgres): convert BYTEA to/from string

Rename findMany and findManyWithCount to findAny and findAnyWithCount.
pg-promise has a method many() which throws if no rows are returned. It
also has a method any() which accepts 0, 1 or more rows as a result
(same as manyOrNone() or result()). Our findMany* methods do
not call the many() method but rather accept any number of rows as a
result.
  • Loading branch information
vasild authored and spkjp committed Oct 14, 2019
1 parent 6a3c9d0 commit 925f052
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core-database-postgres/src/models/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export class Transaction extends Model {
{
name: "vendor_field",
prop: "vendorField",
supportedOperators: [Database.SearchOperator.OP_LIKE],
init: col => col.value !== undefined ? Buffer.from(col.value, 'utf8') : undefined,
supportedOperators: [
Database.SearchOperator.OP_EQ,
Database.SearchOperator.OP_IN,
Database.SearchOperator.OP_LIKE
],
def: undefined,
},
{
Expand Down

0 comments on commit 925f052

Please sign in to comment.