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
Flow PHP's Adapter PostgreSQL is designed to seamlessly integrate PostgreSQL within your ETL (Extract, Transform, Load) workflows. This adapter is built on top of the [PostgreSQL library](/documentation/components/libs/postgresql/client-connection.md), providing efficient data extraction capabilities with built-in pagination support. By harnessing the Adapter PostgreSQL library, developers can tap into robust features for precise database interaction, simplifying complex data transformations and enhancing data processing efficiency.
11
+
Flow PHP's Adapter PostgreSQL is designed to seamlessly integrate PostgreSQL within your ETL (Extract, Transform, Load)
12
+
workflows. This adapter is built on top of
13
+
the [PostgreSQL library](/documentation/components/libs/postgresql/client-connection.md), providing efficient data
14
+
extraction and loading capabilities. By harnessing the Adapter PostgreSQL library, developers can tap into robust
15
+
features for precise database interaction, simplifying complex data transformations and enhancing data processing
This adapter provides two extraction strategies optimized for different use cases:
32
+
This adapter provides:
33
+
34
+
### Extractors
35
+
36
+
Two extraction strategies optimized for different use cases:
28
37
29
38
-**LIMIT/OFFSET Pagination**: Simple pagination suitable for smaller datasets
30
39
-**Keyset (Cursor) Pagination**: Efficient pagination for large datasets with consistent performance
31
40
32
41
Both extractors support:
42
+
33
43
- Raw SQL strings or Query Builder objects
34
44
- Configurable page sizes
35
45
- Maximum row limits
36
46
- Custom schema definitions
37
47
48
+
### Loader
49
+
50
+
A flexible loader supporting:
51
+
52
+
-**INSERT**: Simple inserts with batch support
53
+
-**UPDATE**: Update existing rows by primary key
54
+
-**DELETE**: Delete rows by primary key
55
+
-**UPSERT**: ON CONFLICT handling for insert-or-update operations
56
+
38
57
## Extractor - LIMIT/OFFSET Pagination
39
58
40
-
The `from_pgsql_limit_offset` extractor uses traditional LIMIT/OFFSET pagination. This is simple to use but may have performance degradation on very large datasets with high offsets.
59
+
The `from_pgsql_limit_offset` extractor uses traditional LIMIT/OFFSET pagination. This is simple to use but may have
60
+
performance degradation on very large datasets with high offsets.
41
61
42
62
### Basic Usage
43
63
@@ -93,7 +113,11 @@ data_frame()
93
113
94
114
## Extractor - Keyset (Cursor) Pagination
95
115
96
-
The `from_pgsql_key_set` extractor uses keyset pagination (also known as cursor-based pagination). This provides consistent performance regardless of how deep you paginate, making it ideal for large datasets.
116
+
The `from_pgsql_key_set` extractor uses keyset pagination (also known as cursor-based pagination). This provides
117
+
consistent performance regardless of how deep you paginate, making it ideal for large datasets.
118
+
119
+
> **Note:** The ORDER BY clause is automatically generated from the keyset configuration. You only need to define
120
+
> the sort order once using `pgsql_pagination_key_asc()` or `pgsql_pagination_key_desc()`.
97
121
98
122
### Basic Usage
99
123
@@ -169,44 +193,143 @@ data_frame()
169
193
170
194
### Extractor Functions
171
195
172
-
| Function | Description |
173
-
|----------|-------------|
174
-
|`from_pgsql_limit_offset($client, $query, $pageSize, $maximum)`| Extract using LIMIT/OFFSET pagination |
175
-
|`from_pgsql_key_set($client, $query, $keySet, $pageSize, $maximum)`| Extract using keyset pagination |
0 commit comments