Skip to content

Commit

Permalink
chore: switch to gen_statem
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed Apr 5, 2024
1 parent e95030c commit 27a7291
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 175 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{matrix.os}}
services:
cassandra:
image: cassandra
image: cassandra:4
ports:
- 9042:9042
options: --health-cmd "cqlsh --debug" --health-interval 5s --health-retries 20
Expand All @@ -21,25 +21,19 @@ jobs:
os:
- "ubuntu-22.04"
otp:
- "26.2"
- "25.3"
- "24.3"
rebar3:
- "3.20.0"
include:
- os: "ubuntu-20.04"
otp: "23.3"
rebar3: "3.17.0"
- os: "ubuntu-20.04"
otp: "22.3"
rebar3: "3.17.0"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Cassandra Tables
run: "docker exec ${{ job.services.cassandra.id }} cqlsh -u cassandra -p cassandra --debug localhost 9042 --execute=\"CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': '1'};CREATE TABLE test.tab (first_id bigint, second_id text, col_text text, col_map map<text, text>, PRIMARY KEY (first_id, second_id));DESC keyspaces;\""

- uses: erlef/setup-beam@v1
- uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{ matrix.rebar3 }}
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
erlang 26.2.3-1
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Cassandra Native CQL Driver written in Erlang/OTP.
* CQL BINARY PROTOCOL v3 Support
* Username, Password Authentication
* Query, Prepare and Execute
* Batch Query Support

## Limits

* TODO: Batch Query Support
* TODO: Event Register
* TODO: SSL Support

Expand Down
14 changes: 0 additions & 14 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,4 @@ Compression

Pool

Named Prepared:

{Name :: atom(), Stmt :: iodata()}

{pending, SeqId} -> Name
Name -> PrepreId


prepare(Name :: atom(), State) ->
dict:find(Name, dict)
{ok, Id} ->
error
end

SslOpts::...
17 changes: 17 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
cassandra:
image: cassandra:4
ports:
- 9042:9042
healthcheck:
test: ["CMD", "cqlsh", "--debug"]
interval: 5s
retries: 20
init:
image: cassandra:4
depends_on:
- cassandra
restart: "no"
entrypoint: ["/init.sh"]
volumes:
- ./init.sh:/init.sh
10 changes: 10 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

until printf "" 2>>/dev/null >>/dev/tcp/cassandra/9042; do
sleep 5;
echo "Waiting for cassandra...";
done

echo "Creating keyspace and table..."
cqlsh cassandra -u cassandra -p cassandra -e "CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};"
cqlsh cassandra -u cassandra -p cassandra -e "CREATE TABLE IF NOT EXISTS test.tab (first_id bigint, second_id text, col_text text, col_map map<text, text>, PRIMARY KEY (first_id, second_id));"
2 changes: 1 addition & 1 deletion src/ecql.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, ecql,
[
{description, "Cassandra Native CQL Driver"},
{vsn, "0.6.0"},
{vsn, "0.7.0"},
{modules, []},
{registered, []},
{applications, [
Expand Down
Loading

0 comments on commit 27a7291

Please sign in to comment.