@@ -687,7 +687,7 @@ statements apply here as well
687687const my_id = 17 ;
688688await client .queryArray ` UPDATE TABLE X SET Y = 0 WHERE Z = ${my_id } ` ;
689689
690- // Invalid attempt to replace an specifier
690+ // Invalid attempt to replace a specifier
691691const my_table = " IMPORTANT_TABLE" ;
692692const my_other_id = 41 ;
693693await client
@@ -699,12 +699,12 @@ await client
699699When a query is executed, the database returns all the data serialized as string
700700values. The ` deno-postgres ` driver automatically takes care of decoding the
701701results data of your query into the closest JavaScript compatible data type.
702- This makes it easy to work with the data in your applciation using native
702+ This makes it easy to work with the data in your application using native
703703Javascript types. A list of implemented type parsers can be found
704704[ here] ( https://github.com/denodrivers/postgres/issues/446 ) .
705705
706706However, you may have more specific needs or may want to handle decoding
707- yourself in your application. The driver provides 2 ways to handle decoding of
707+ yourself in your application. The driver provides two ways to handle decoding of
708708the result data:
709709
710710#### Decode strategy
@@ -714,9 +714,9 @@ decode the result data. This can be done by setting the `decodeStrategy`
714714controls option when creating your query client. The following options are
715715available:
716716
717- - ` auto ` : (** default** ) deno-postgres parses the data into JS types or objects
717+ - ` auto ` : (** default** ) deno-postgres parses the data into JS types or objects
718718 (non-implemented type parsers would still return strings).
719- - ` string ` : all values are returned as string, and the user has to take care of
719+ - ` string ` : all values are returned as string, and the user has to take care of
720720 parsing
721721
722722``` ts
@@ -733,7 +733,7 @@ available:
733733 const result = await client .queryArray (
734734 " SELECT ID, NAME, AGE, BIRTHDATE FROM PEOPLE WHERE ID = 1" ,
735735 );
736- console .log (result .rows ); // [[1, "Laura", 25, 1996-01-01T00:00:00.000Z ]]
736+ console .log (result .rows ); // [[1, "Laura", 25, Date(' 1996-01-01') ]]
737737
738738 // versus
739739
@@ -757,8 +757,8 @@ available:
757757
758758You can also provide custom decoders to the client that will be used to decode
759759the result data. This can be done by setting the ` decoders ` controls option in
760- the client configuration. This options is a map object where the keys are the
761- type names or Oid number and the values are the custom decoder functions.
760+ the client configuration. This option is a map object where the keys are the
761+ type names or Oid numbers and the values are the custom decoder functions.
762762
763763You can use it with the decode strategy. Custom decoders take precedence over
764764the strategy and internal parsers.
@@ -785,7 +785,7 @@ the strategy and internal parsers.
785785 const result = await client .queryObject (
786786 " SELECT ID, NAME, IS_ACTIVE FROM PEOPLE" ,
787787 );
788- console .log (result .rows [0 ]); // {id: '1', name: 'Javier', _bool : { value: false, type: "boolean"}}
788+ console .log (result .rows [0 ]); // {id: '1', name: 'Javier', is_active : { value: false, type: "boolean"}}
789789}
790790```
791791
0 commit comments