File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Currently honeysql-postgres supports the following postgres specific clauses:
2222 - drop column
2323 - rename column
2424- insert-into-as
25+ - pattern matching (ILIKE and NOT ILIKE)
2526
2627## Index
2728
@@ -37,6 +38,7 @@ Currently honeysql-postgres supports the following postgres specific clauses:
3738 - [ create table] ( https://github.com/nilenso/honeysql-postgres#create-table )
3839 - [ drop table] ( https://github.com/nilenso/honeysql-postgres#drop-table )
3940 - [ alter table] ( https://github.com/nilenso/honeysql-postgres#alter-table )
41+ - [ pattern matching] ( https://github.com/nilenso/honeysql-postgres#pattern-matching )
4042 - [ SQL functions] ( https://github.com/nilenso/honeysql-postgres#sql-functions )
4143- [ License] ( https://github.com/nilenso/honeysql-postgres#license )
4244
@@ -161,6 +163,25 @@ use `alter-table` along with `add-column` & `drop-column` to modify table level
161163=> [" ALTER TABLE employees DROP COLUMN address" ]
162164```
163165
166+ ### pattern matching
167+ The ` ilike ` and ` not-ilike ` operators can be used to query data using a pattern matching technique.
168+ - like
169+ ``` clj
170+ (-> (select :name )
171+ (from :products )
172+ (where [:ilike :name " %name%" ])
173+ sql/format)
174+ => [" SELECT * FROM products WHERE name ILIKE ?" " %name%" ]
175+ ```
176+ - not-ilike
177+ ``` clj
178+ (-> (select :name )
179+ (from :products )
180+ (where [:not-ilike :name " %name%" ])
181+ sql/format)
182+ => [" SELECT * FROM products WHERE name NOT ILIKE ?" " %name%" ]
183+ ```
184+
164185### SQL functions
165186The following are the SQL functions added in ` honeysql-postgres `
166187- not
You can’t perform that action at this time.
0 commit comments