GocqlX

GocqlX is an extension to the ScyllaDB/Cassandra driver for Go that aims to improve developer productivity without sacrificing performance. It is inspired by the popular sqlx library for standard SQL databases.

Why GocqlX?

Working with the raw gocql driver can be verbose, especially when dealing with struct scanning and parameter binding. GocqlX solves this by providing:

  • Struct Binding: Bind query parameters directly from struct fields or maps.
  • Struct Scanning: Scan query results directly into structs or slices of structs.
  • Query Builder: A fluent API (qb package) to construct CQL statements programmatically.
  • Table Abstraction: Reduce boilerplate for standard CRUD operations (table package).
  • Migrations: A built-in tool for managing database schema versions (migrate package).
  • Performance: Designed to be as fast as the raw driver.

Key Features

  • Named Parameters: Support for named parameters (e.g., :first_name) in queries.
  • UDT Support: Easy marshaling of User Defined Types by embedding a marker interface.
  • Scannable Iterators: Enhanced iterators that support struct scanning.
  • Schema Generation: A CLI tool (schemagen) to generate Go structs from your database schema.

License

This project is distributed under the Apache 2.0 license.