Skip to content

Commit

Permalink
Make substitution in strings optional
Browse files Browse the repository at this point in the history
  • Loading branch information
vlidholt committed May 17, 2019
1 parent 8355255 commit 61d7045
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/substituter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class PostgreSQLFormat {

static String substitute(String fmtString, Map<String, dynamic> values,
{SQLReplaceIdentifierFunction replace: null}) {
if (values == null)
return fmtString;

final converter = new PostgresTextEncoder(true);
values ??= {};
replace ??= (spec, index) => converter.convert(values[spec.name]);
Expand Down

0 comments on commit 61d7045

Please sign in to comment.