You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+109-3Lines changed: 109 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,18 +48,20 @@ Features
48
48
- `bool`: `text`(1..5) and `int`,
49
49
- `double precision`, `float` and `numeric`: `real` values and special values with `text` affinity (`+Infinity`, `-Infinity`, `NaN`),
50
50
- `macaddr`: `text`(12..17) or `blob`(6) or `integer`,
51
-
- `macaddr8`: `text`(16..23) or `blob`(8) or `integer`.
51
+
- `macaddr8`: `text`(16..23) or `blob`(8) or `integer`,
52
+
- `inet`: `text`(8..49) or `blob`(4..5 IP v4, 16..17 IP v6) or `integer` (IP v4).
52
53
- Support mixed SQLite [data affinity](https://www.sqlite.org/datatype3.html) output (`INSERT`/`UPDATE`) for such data types as
53
54
- `timestamp`: `text`(default) or `int`,
54
55
- `uuid`: `text`(36) or `blob`(16)(default),
55
56
- `macaddr`: `text`(17) or `blob`(6) or `integer`(default),
56
-
- `macaddr8`: `text`(23) or `blob`(8) or `integer`(default).
57
+
- `macaddr8`: `text`(23) or `blob`(8) or `integer`(default),
58
+
- `inet`: `integer` (default for IP v4) or `blob`(4..5 IP v4, 16..17 default for IP v6) or `text`(8..49).
57
59
- Full support for `+Infinity` (means ∞) and `-Infinity` (means -∞) special values for IEEE 754-2008 numbers in `double precision`, `float` and `numeric` columns including such conditions as ` n < '+Infinity'` or ` m > '-Infinity'`.
58
60
- Bidirectional data transformation for `geometry` and `geography` data types for SpatiaLite ↔ PostGIS. [EWKB](https://libgeos.org/specifications/wkb/#extended-wkb) data transport is used. See [GIS support description](GIS.md).
59
61
60
62
### Pushing down
61
63
-`WHERE` clauses are pushdowned
62
-
- Aggregate function are pushdowned
64
+
- Aggregate functions are pushdowned
63
65
-`ORDER BY` is pushdowned
64
66
- Joins (left/right/inner/cross/semi) are pushdowned
65
67
-`CASE` expressions are pushdowned.
@@ -254,6 +256,7 @@ SQLite `NULL` affinity always can be transparent converted for a nullable column
@@ -625,6 +628,17 @@ Array support is experimental. Please be careful.
625
628
-`sqlite_fdw` UUID values support exists only for `uuid` columns in foreign table. SQLite documentation recommends to store UUID as value with both `blob` and `text`[affinity](https://www.sqlite.org/datatype3.html). `sqlite_fdw` can pushdown both reading and filtering both `text` and `blob` values.
626
629
- Expected affinity of UUID value in SQLite table determined by `column_type` option of the column
627
630
for `INSERT` and `UPDATE` commands. PostgreSQL supports both `blob` and `text`[affinity](https://www.sqlite.org/datatype3.html).
631
+
- Usual form of UUID from a value with `blob` affinity can be generated with such SQLite query as
632
+
```sql
633
+
select case when typeof(u) ='blob' then
634
+
substr(lower(hex(u)),1,8) ||'-'||
635
+
substr(lower(hex(u)),9,4) ||'-'||
636
+
substr(lower(hex(u)),13,4) ||'-'||
637
+
substr(lower(hex(u)),17,4) ||'-'||
638
+
substr(lower(hex(u)),21,12)
639
+
else null end uuid_canon
640
+
from"type_UUID";
641
+
```
628
642
629
643
### bit and varbit support
630
644
-`sqlite_fdw` PostgreSQL `bit`/`varbit` values support based on `int` SQLite data affinity, because there is no per bit operations for SQLite `blob` affinity data. Maximum SQLite `int` affinity value is 8 bytes length, hence maximum `bit`/`varbit` values length is 64 bits.
@@ -633,6 +647,98 @@ for `INSERT` and `UPDATE` commands. PostgreSQL supports both `blob` and `text` [
633
647
### MAC address support
634
648
-`sqlite_fdw` PostgreSQL `macaddr`/`macaddr8` values support based on `int` SQLite data affinity, because there is no per bit operations for SQLite `blob` affinity data. For `macaddr` out of range error is possible because this type is 6 bytes length, but SQLite `int` can store value up to 8 bytes.
635
649
-`sqlite_fdw` doesn't pushdown any operations with MAC adresses because there is 3 possible affinities for it in SQLite: `integer`, `blob` and `text`.
650
+
### IP address support
651
+
-`sqlite_fdw` PostgreSQL `inet` values support based on `int` SQLite data affinity for IP v4 and `blob` SQLite data affinity for IP v6.
652
+
- Usual form of IP v4 address with cidr from a value with `integer` affinity can be generated with such SQLite query as
0 commit comments