Coder Social home page Coder Social logo

cqlc's Introduction

cqlc

Build Status

This a fork of relops/cqlc the upstream is no longer maintained.

Usage

# install the generator to $GOPATH/bin
make install
# generate table and column definition based on schema in keyspace cqlc
cqlc --instance=127.0.0.1 --keyspace=cqlc --package=foo --output=foo.go --symbols

You need to change the repo path in glide.yaml to use this fork

- package: github.com/relops/cqlc
  version: master
  repo: https://github.com/pingginp/cqlc.git

If you use go mod, add the following in your go.mod, go mod wiki

replace github.com/relops/cqlc => github.com/pingginp/cqlc v0.12.0

Dev

  • clone the repo to $GOPATH/src/github.com/relops/cqlc
# generate columns
make cqlc/columns.go
# e2e test
# TODO: you need to run it twice if schema changed because first time it will generate package based on schema, which won't get compiled ...
# this same as when using latex ... you do xelatex several times when there is bib ...
make travis-test
make travis-tear
# release, update cqlc/ver.go, build and zip binary for all three platforms, only mac is tested
make release

The code has two part, runtime and generator

Runtime

The main modification to the runtime are listed below

Generator

The main modification to the generator are listed below

  • generator now compiles, caused by breaking change of constant name in gocql
  • support Cassandra 3 by adding a new literalType mapping for text -> string #12
  • allow Eq on all columns to support IF in DELETE

The overall generator logic is

  • get table meta using gocql
  • render the template defined in tmpl.go using template helper methods defined in template.go
    • valueType is returning empty value for text, just add a new mapping in literalTypes fixed this #7

cqlc's People

Contributors

0x6e6562 avatar pingginp avatar aackerman avatar philipsoutham avatar nsd20463 avatar gitter-badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.