Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

πŸ“‡ a super tiny query builder for cassandra, made in go

License

Notifications You must be signed in to change notification settings

flikmsg/go-cql-query-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

go-cql-query-builder

πŸ“‡ a super tiny query builder for cassandra, made in go

To do

  • Add UPDATE support
  • Add DELETE support

Usage

package main

import (
	"log"

	cqlquery "github.com/flikmsg/go-cql-query-builder"
)

func main() {
	if _, err := cqlquery.Connect([]string{"127.0.0.1"}, "test_keyspace"); err != nil {
		log.Fatal(err)
	}

	query := cqlquery.Select("users_by_username", []string{"user_id", "username"}, map[string]interface{}{
		"username": "tyler",
	})

	results := query.Iter()
	defer results.Close()

	m := map[string]interface{}{}
	if results.MapScan(m) {
		log.Printf("User ID: %s, Username: %s", m["user_id"], m["username"])
	} else {
		log.Println("No user found.")
	}
}

About

πŸ“‡ a super tiny query builder for cassandra, made in go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages