Skip to content

Commit 22671ba

Browse files
authored
Remove outdated documentation (#193)
1 parent c3b3504 commit 22671ba

File tree

1 file changed

+6
-39
lines changed

1 file changed

+6
-39
lines changed

README.md

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ You need `libpq` installed and available in your `$PATH`.
1515
This package is uploaded to MavenCentral and supports macOS and linuxX64.
1616
Windows is currently not supported.
1717

18-
Supported SQLDelight version: 2.0.0-alpha05.
19-
2018
````kotlin
2119
repositories {
2220
mavenCentral()
@@ -26,7 +24,7 @@ dependencies {
2624
implementation("app.softwork:postgres-native-sqldelight-driver:LATEST")
2725
}
2826

29-
// optional SQLDelight setup: requires 2.0.0-alpha05
27+
// optional SQLDelight setup:
3028
sqldelight {
3129
databases.register("NativePostgres") {
3230
dialect("app.softwork:postgres-native-sqldelight-dialect:LATEST")
@@ -49,10 +47,11 @@ val driver = PostgresNativeDriver(
4947
)
5048
```
5149

50+
### Listeners
51+
5252
This driver supports local and remote listeners.
53-
Local listeners only notify this client, ideally for testing or using the database with only one client at a time with
54-
SQLDelight only.
55-
Remote listener support uses `NOTIFY` and `LISTEN`, so you can use this with multiple clients or with existing database
53+
Local listeners only notify this client, ideally for testing or using the database with only one client at a time.
54+
Remote listener support uses `NOTIFY` and `LISTEN`, so you can use this to sync multiple clients or with existing database
5655
triggers.
5756
SQLDelight uses and expects the table name as payload, but you can provide a mapper function.
5857

@@ -69,35 +68,9 @@ The identifier is used to reuse prepared statements.
6968
driver.execute(identifier = null, sql = "INSERT INTO foo VALUES (42)", parameters = 0, binders = null)
7069
```
7170

72-
It also supports a real lazy cursor or a Flow. The `fetchSize` parameter defines how many rows are fetched at once:
71+
It also supports a real lazy cursor by using a `Flow`. The `fetchSize` parameter defines how many rows are fetched at once:
7372

7473
```kotlin
75-
val names: List<Simple> = driver.executeQueryWithNativeCursor(
76-
identifier = null,
77-
sql = "SELECT index, name, bytes FROM foo",
78-
mapper = { cursor ->
79-
// You need to call `next` and use the cursor to return your type, here it is a list.
80-
81-
// Important, don't leak this cursor, eg by returning a Sequence,
82-
// otherwise the cursor will be closed before fetching rows.
83-
// If you need to use an async iterator, use the `Flow` overload, `executeQueryAsFlow`.
84-
buildList {
85-
while (cursor.next()) {
86-
add(
87-
Simple(
88-
index = cursor.getLong(0)!!.toInt(),
89-
name = cursor.getString(1),
90-
byteArray = cursor.getBytes(2)
91-
)
92-
)
93-
}
94-
}
95-
},
96-
parameters = 0,
97-
fetchSize = 100,
98-
binders = null
99-
)
100-
10174
val namesFlow: Flow<Simple> = driver.executeQueryAsFlow(
10275
identifier = null,
10376
sql = "SELECT index, name, bytes FROM foo",
@@ -146,12 +119,6 @@ For compilers to find libpq you may need to set:
146119

147120
If you install libpq with homebrew, it will install the platform-specific artifact.
148121

149-
| Host | Supported test targets |
150-
|-------------|------------------------|
151-
| linux x64 | linux x64 |
152-
| macOS x64 | macOS x64 |
153-
| macOS arm64 | macOS arm64 |
154-
155122
To test other platforms, eg. linux x64 on macOS, you need to install the platform-specific libpq of linux x64 too.
156123

157124
To start the postgres instance, you can use docker:

0 commit comments

Comments
 (0)