Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Syntax error on opening a Cassandra or ScyllaDB table, from an `OFFSET` that CQL does not have.
- Pre-connect script failures sometimes reported without the script's own error message.
- Failed MongoDB statements, including writes the server rejected, reported as successful with an empty result.
- Save reporting success after leaving out an edit it could not write, such as a new MongoDB document left empty. (#3132)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,10 @@ extension PluginMetadataRegistry {
supportsDropIndex: false,
supportsModifyPrimaryKey: false,
supportsOpportunisticTLS: false,
supportsClientKeyPassphrase: true
supportsClientKeyPassphrase: true,
pagination: .leadingRowsOnly(
maximumRows: SettingsValidationRules.defaultPageSizeRange.upperBound
)
),
schema: PluginMetadataSnapshot.SchemaInfo(
defaultSchemaName: "public",
Expand Down Expand Up @@ -870,7 +873,10 @@ extension PluginMetadataRegistry {
supportsDropIndex: false,
supportsModifyPrimaryKey: false,
supportsOpportunisticTLS: false,
supportsClientKeyPassphrase: true
supportsClientKeyPassphrase: true,
pagination: .leadingRowsOnly(
maximumRows: SettingsValidationRules.defaultPageSizeRange.upperBound
)
),
schema: PluginMetadataSnapshot.SchemaInfo(
defaultSchemaName: "public",
Expand Down
17 changes: 17 additions & 0 deletions TableProTests/Models/PaginationCapabilityTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ struct PaginationCapabilityTests {
#expect(PaginationCapability.of(.postgresql) == .offset)
}

@Test("Cassandra and ScyllaDB never seek, because CQL has no OFFSET")
func cassandraAndScyllaDBHaveNoSeeking() {
#expect(!PaginationCapability.of(.cassandra).allowsSeeking)
#expect(!PaginationCapability.of(.scylladb).allowsSeeking)
}

@Test("A Cassandra or ScyllaDB browse states a LIMIT and never an OFFSET")
func cassandraAndScyllaDBBrowseNeverOffsets() {
for databaseType in [DatabaseType.cassandra, .scylladb] {
let builder = TableQueryBuilder(databaseType: databaseType, pagination: .of(databaseType))
let query = builder.buildBaseQuery(tableName: "users", schemaName: "shop", limit: 1_000, offset: 0)

#expect(query == #"SELECT * FROM "shop"."users" LIMIT 1000"#)
#expect(!query.contains("OFFSET"))
}
}

@Test("A leading-rows table query states a clamped LIMIT and never an OFFSET")
func builderNeverOffsets() {
let builder = TableQueryBuilder(databaseType: .cloudflareR2SQL, pagination: leadingRows)
Expand Down