sqlx4k 1.3.0 released - Now with PostgreSQL Messag...
# feed
y
sqlx4k 1.3.0 released - Now with PostgreSQL Message Queue (PGMQ) support I’m excited to announce the release of sqlx4k 1.3.0, a Kotlin Multiplatform SQL toolkit. What’s New in 1.3.0 PostgreSQL Message Queue (PGMQ) Support (Experimental) The biggest addition is a new sqlx4k-postgres-pgmq module that brings native PGMQ support to Kotlin! This allows you to use PostgreSQL as a message queue with a simple, type-safe API:
Copy code
// Create a client
val client = PgMqClient(pool, "my_queue")
// Send messages
client.send(MyMessage(data = "hello"))
client.sendBatch(listOf(msg1, msg2, msg3))
// Consume messages
val consumer = PgMqConsumer(pool, "my_queue")
consumer.consume { message ->
// Process message
}
// Get queue metrics
val metrics = client.metrics()
The module includes: • Full CRUD operations (send, pop, archive, delete) • Batch operations • Real-time consumption with listen/notify • Queue metrics and monitoring • Other Notable Changes • Enhanced SQL Validation: Improved KSP-based SQL schema validation with a configurable migration path • Migration Flexibility: New Migrator.migrate() overload that accepts ListMigrationFile • Context Parameters: Added comprehensive documentation for repository context parameters Check it out on GitHub: https://github.com/smyrgeorge/sqlx4k Feedback and contributions are always welcome!
🆒 3
l
This looks quite interesting. Kap currently only has SQL support when using the JVM backend, because I call into JDBC. However, this would open up support for the native version as well. My question is: When using sqlx4k with the JVM, can it use JDBC, and thus support other databases?
y
You can use Jdbc yes. Use the "core" sqlx4k package and then create then your
sqlx4k-jdbc
implementation. Check how is done in the postgres module: https://github.com/smyrgeorge/sqlx4k/blob/main/sqlx4k-postgres/src/jvmMain/kotlin/io/github/smyrgeorge/sqlx4k/postgres/PostgreSQL.kt