Skip to content

EntritGroup/db.cassandra.csharp.query-builder

Repository files navigation

C# Query Builder for Apache Cassandra

Query builder for the Cassandra database

Description

This library makes it easy for developers to create CQL queries in code to be used as prepared statements for the Cassandra database. Perfect to use together with the Datastax CassandraCSharpDriver for prepared statements and batch statements.

Installing the library

Get it on Nuget: https://www.nuget.org/packages/CassandraCSharpQueryBuilder/

PM> Install-Package CassandraCSharpQueryBuilder

Using the library

There are many examples in the sample project as well as in the test project. Most common use cases below are linked to examples in these projects.

Create columns

For creating tables as well as creating queries, you need to specify columns and their respective type.

Examples of creating columns

Column Types

As per the documentation for respective type: https://cassandra.apache.org/doc/latest/cql/types.html

Query Strings

Create keyspace query

Drop keyspace query

Create table query

Create user defined types query

Create materalized view query

Insert query

Select query

Update query

Delete query

Counter query

Contribution guidelines

There are many ways in which you can participate in the project, for example:

  • Submit bugs and feature requests, and help us verify as they are checked in
  • Review source code changes
  • Review the documentation and make pull requests for anything from typos to new content

Tests

You can run the tests by typing "dotnet test .\tests\CassandraQueryBuilder.Tests.UT"

Releases

Version 1.4.0

Added support for default replication factor for NetworkTopologyStrategy when creating keyspace
Removed the need of having the same length of columns for AS, Functions and Aggregates

Version 1.3.1

Fixed bug for update query when only TTL is specified

Version 1.3.0

Added support for multiple counter updates in same query
Added support for functions such as TTL on select columns
Added support for adding own functions and aggregates
Added support for naming columns in select queries using "as"

Version 1.2.0

Added support for Frozen and Tuple
Added support for creating User Defined Types

Version 1.1.2

Fixed bug for materialized view when only primary keys are present

Version 1.1.1

Fixed bug for create table when only primary keys are present

Version 1.1.0

Added support for TimeWindowCompactionStrategy

Version 1.0.0

Initial release

About

Query builder for the Cassandra database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages