Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit a18474a

Browse files
committed
Update README.md
1 parent 902ef2e commit a18474a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,15 @@ If using PostgreSQL you can take advantage of its complex Array Types and utiliz
902902
```csharp
903903
var ids = new[]{ 1, 2, 3};
904904
var q = Db.From<Table>()
905-
.And("ARRAY[{0}] && ref_ids", ids.Join(","))
905+
.Where("ARRAY[{0}] && ref_ids", ids.Join(","))
906+
var results = db.Select(q);
907+
```
908+
909+
When comparing a string collection you can use `SqlInValues` to create a quoted SQL IN list, e.g:
910+
911+
```csharp
912+
var q = Db.From<Table>()
913+
.Where($"ARRAY[{new SqlInValues(cities).ToSqlInString()}] && cities");
906914
var results = db.Select(q);
907915
```
908916

0 commit comments

Comments
 (0)