Skip to content

Commit

Permalink
fdbq -> fql. Fixed bad git version. (#208)
Browse files Browse the repository at this point in the history
* fdbq -> fql. Fixed bad git version.

* Updated the animated gif.
  • Loading branch information
janderland authored Oct 11, 2024
1 parent 2d7ace4 commit eb36099
Show file tree
Hide file tree
Showing 59 changed files with 200 additions and 200 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.idea
/fdbq
/fql
*.cluster
34 changes: 17 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ function print_help {
cat << END
build.sh is a facade for docker compose. It runs a set of
optional tasks in the order specified below. This is the same
script used by CI/CD to build, test, and package FDBQ.
script used by CI/CD to build, test, and package FQL.
If the '--image build' flag is set then the script starts off by
running 'docker build' for the 'fdbq-build' docker image. The tag
running 'docker build' for the 'fql-build' docker image. The tag
is determined by the git tag/hash. This image is used to run the
'generate' and 'verify' tasks below.
Expand All @@ -27,13 +27,13 @@ Arm Macs where Dockerfile linting is currently unsupported.
If the --docs' flag is set then the documentation HTML will be
generated under the /docs directory.
If the '--image fdbq' flag is set then the script runs 'docker
build' for the 'fdbq' docker image. The tag is determined by the
If the '--image fql' flag is set then the script runs 'docker
build' for the 'fql' docker image. The tag is determined by the
git tag/hash and the version of the FDB library specified in the
'.env' file.
If the '--run' flag is provided then all the args after this flag
are passed to an instance of the 'fdbq' docker image. Normally
are passed to an instance of the 'fql' docker image. Normally
this image expects a cluster file as the first argument but this
script takes care of starting an FDB cluster and providing the
cluster file as the first argument. Note that this is the same
Expand All @@ -47,7 +47,7 @@ then the script exits immediately.
Multiple image names can be specified on the '--image' flag by
separating them with commas.
./build.sh --image build,fdbq
./build.sh --image build,fql
When building Docker images, the dependencies of the Dockerfile
are specified in the '.env' file. When this file is changed,
Expand Down Expand Up @@ -155,8 +155,8 @@ while [[ $# -gt 0 ]]; do
build)
IMAGE_BUILD="x"
;;
fdbq)
IMAGE_FDBQ="x"
fql)
IMAGE_FQL="x"
;;
*)
fail "Invalid build target '$service'"
Expand All @@ -168,8 +168,8 @@ while [[ $# -gt 0 ]]; do

--run)
shift 1
RUN_FDBQ="x"
FDBQ_ARGS=("$@")
RUN_FQL="x"
FQL_ARGS=("$@")
shift $#
;;

Expand Down Expand Up @@ -205,9 +205,9 @@ BUILD_COMMAND="$(join_array ' && ' "${BUILD_TASKS[@]}")"
echo "BUILD_COMMAND=${BUILD_COMMAND}"
export BUILD_COMMAND

FDBQ_COMMAND=${FDBQ_ARGS[*]}
echo "FDBQ_COMMAND=${FDBQ_COMMAND}"
export FDBQ_COMMAND
FQL_COMMAND=${FQL_ARGS[*]}
echo "FQL_COMMAND=${FQL_COMMAND}"
export FQL_COMMAND

DOCKER_TAG="$(code_version)_fdb.$(fdb_version)"
echo "DOCKER_TAG=${DOCKER_TAG}"
Expand All @@ -224,10 +224,10 @@ if [[ -n "$BUILD_COMMAND" ]]; then
(set -x; docker compose run build /bin/sh -c "$BUILD_COMMAND")
fi

if [[ -n "$IMAGE_FDBQ" ]]; then
(set -x; docker compose build fdbq)
if [[ -n "$IMAGE_FQL" ]]; then
(set -x; docker compose build fql)
fi

if [[ -n "$RUN_FDBQ" ]]; then
(set -x; docker compose run fdbq 'docker:docker@{fdb}:4500' "${FDBQ_ARGS[@]}")
if [[ -n "$RUN_FQL" ]]; then
(set -x; docker compose run fql 'docker:docker@{fdb}:4500' "${FQL_ARGS[@]}")
fi
18 changes: 9 additions & 9 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ services:
# linting, and testing the code.
build:
container_name: "build"
image: "docker.io/janderland/fdbq-build:${DOCKER_TAG}"
image: "docker.io/janderland/fql-build:${DOCKER_TAG}"
platform: "linux/amd64"
build:
context: "./docker"
target: "builder"
platforms:
- "linux/amd64"
args: &build_args
FDBQ_VER: "${DOCKER_TAG}"
FQL_VER: "${DOCKER_TAG}"
FDB_LIB_URL: "${FDB_LIB_URL}"
GO_URL: "${GO_URL}"
GOLANGCI_LINT_VER: "${GOLANGCI_LINT_VER}"
Expand All @@ -25,16 +25,16 @@ services:
PANDOC_URL: "${PANDOC_URL}"
depends_on:
- "fdb"
working_dir: "/fdbq"
working_dir: "/fql"
volumes:
- ".:/fdbq"
- ".:/fql"
- "cache:/cache"

# The fdbq service allows us to build and test the
# fdbq Docker image.
fdbq:
container_name: "fdbq"
image: "docker.io/janderland/fdbq:${DOCKER_TAG}"
# The fql service allows us to build and test the
# fql Docker image.
fql:
container_name: "fql"
image: "docker.io/janderland/fql:${DOCKER_TAG}"
platform: "linux/amd64"
build:
context: "."
Expand Down
14 changes: 7 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get update &&\
apt-get install --no-install-recommends -y \
build-essential=12.9 \
ca-certificates=20230311 \
git=1:2.39.2-1.1 \
git=1:2.39.5-0+deb12u1 \
curl=7.88.1-10+deb12u7 &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -52,10 +52,10 @@ RUN curl -Lo /pandoc.deb $PANDOC_URL &&\
rm /pandoc.deb

# Configure git so it allows any user to run git commands
# on the /fdbq directory. This allows the user which runs
# on the /fql directory. This allows the user which runs
# CI to be different from the user which built the Docker
# image.
RUN git config --global --add safe.directory /fdbq
RUN git config --global --add safe.directory /fql


# 'gobuild' executes 'go build'.
Expand All @@ -64,11 +64,11 @@ FROM builder AS gobuild
COPY . /src
WORKDIR /src

ARG FDBQ_VER
RUN go build -o /fdbq -ldflags="-X 'github.com/janderland/fdbq/internal/app.Version=${FDBQ_VER}'"
ARG FQL_VER
RUN go build -o /fql -ldflags="-X 'github.com/janderland/fql/internal/app.Version=${FQL_VER}'"


# The final stage builds the 'fdbq' image.
# The final stage builds the 'fql' image.
FROM debian:12

COPY --from=gobuild /fdb.deb /fdb.deb
Expand All @@ -77,6 +77,6 @@ RUN dpkg -i ./fdb.deb &&\

ENV TERM="xterm-256color"

COPY --from=gobuild /fdbq /fdbq
COPY --from=gobuild /fql /fql
COPY ./docker/shim.sh /shim.sh
ENTRYPOINT ["/shim.sh"]
4 changes: 2 additions & 2 deletions docker/shim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ echo
# Shift the rest of the arguments up, if there are any.
shift || true

# Create the cluster file and run FDBQ with the
# Create the cluster file and run FQL with the
# remaining arguments.
echo "$CLUSTER_FILE" > /etc/foundationdb/fdb.cluster
/fdbq "$@"
/fql "$@"
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>FQL</h1>
<pre class="lang-fql result"><code>/user(9323,&quot;Timothy&quot;,&quot;Johnson&quot;,37)=nil
/user(24335,&quot;Andrew&quot;,&quot;Johnson&quot;,42)=nil
/user(33423,&quot;Ryan&quot;,&quot;Johnson&quot;,0x0ffa83,42.2)=nil</code></pre>
<p>FQL is an <a href="https://github.com/janderland/fdbq">open
<p>FQL is an <a href="https://github.com/janderland/fql">open
source</a> query language for <a
href="https://www.foundationdb.org/">Foundation DB</a>. It’s query
semantics mirror Foundation DB’s <a
Expand Down Expand Up @@ -57,7 +57,7 @@ <h1>FQL</h1>
</ul>
<h1 id="overview">Overview</h1>
<p>FQL is specified as a <a
href="https://github.com/janderland/fdbq/blob/main/syntax.ebnf">context-free
href="https://github.com/janderland/fql/blob/main/syntax.ebnf">context-free
grammar</a>. The queries look like key-values encoded using the
directory &amp; tuple layers.</p>
<pre class="lang-fql query"><code>/my/directory(&quot;my&quot;,&quot;tuple&quot;)=4000</code></pre>
Expand Down Expand Up @@ -536,9 +536,9 @@ <h1 id="as-a-layer">As a Layer</h1>
&quot;github.com/apple/foundationdb/bindings/go/src/fdb&quot;
&quot;github.com/apple/foundationdb/bindings/go/src/fdb/directory&quot;

&quot;github.com/janderland/fdbq/engine&quot;
&quot;github.com/janderland/fdbq/engine/facade&quot;
kv &quot;github.com/janderland/fdbq/keyval&quot;
&quot;github.com/janderland/fql/engine&quot;
&quot;github.com/janderland/fql/engine/facade&quot;
kv &quot;github.com/janderland/fql/keyval&quot;
)

func _() {
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include-before: |
/user(24335,"Andrew","Johnson",42)=nil
/user(33423,"Ryan","Johnson",0x0ffa83,42.2)=nil
```
FQL is an [open source](https://github.com/janderland/fdbq)
FQL is an [open source](https://github.com/janderland/fql)
query language for
[Foundation DB](https://www.foundationdb.org/). It's query
semantics mirror Foundation DB's [core data
Expand All @@ -25,7 +25,7 @@ include-before: |
# Overview

FQL is specified as a [context-free
grammar](https://github.com/janderland/fdbq/blob/main/syntax.ebnf).
grammar](https://github.com/janderland/fql/blob/main/syntax.ebnf).
The queries look like key-values encoded using the directory
& tuple layers.

Expand Down Expand Up @@ -642,9 +642,9 @@ import (
"github.com/apple/foundationdb/bindings/go/src/fdb"
"github.com/apple/foundationdb/bindings/go/src/fdb/directory"
"github.com/janderland/fdbq/engine"
"github.com/janderland/fdbq/engine/facade"
kv "github.com/janderland/fdbq/keyval"
"github.com/janderland/fql/engine"
"github.com/janderland/fql/engine/facade"
kv "github.com/janderland/fql/keyval"
)
func _() {
Expand Down
14 changes: 7 additions & 7 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"github.com/pkg/errors"
"github.com/rs/zerolog"

"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fdbq/engine/internal"
"github.com/janderland/fdbq/engine/stream"
"github.com/janderland/fdbq/keyval"
"github.com/janderland/fdbq/keyval/class"
"github.com/janderland/fdbq/keyval/convert"
"github.com/janderland/fdbq/keyval/values"
"github.com/janderland/fql/engine/facade"
"github.com/janderland/fql/engine/internal"
"github.com/janderland/fql/engine/stream"
"github.com/janderland/fql/keyval"
"github.com/janderland/fql/keyval/class"
"github.com/janderland/fql/keyval/convert"
"github.com/janderland/fql/keyval/values"
)

// SingleOpts configures how an [Engine.ReadSingle] call is executed.
Expand Down
6 changes: 3 additions & 3 deletions engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"

"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fdbq/engine/internal"
q "github.com/janderland/fdbq/keyval"
"github.com/janderland/fql/engine/facade"
"github.com/janderland/fql/engine/internal"
q "github.com/janderland/fql/keyval"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions engine/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"github.com/apple/foundationdb/bindings/go/src/fdb"
"github.com/apple/foundationdb/bindings/go/src/fdb/directory"

"github.com/janderland/fdbq/engine"
"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fdbq/keyval"
"github.com/janderland/fql/engine"
"github.com/janderland/fql/engine/facade"
"github.com/janderland/fql/keyval"
)

func Example() {
Expand Down
6 changes: 3 additions & 3 deletions engine/internal/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (

"github.com/pkg/errors"

"github.com/janderland/fdbq/keyval"
"github.com/janderland/fdbq/keyval/values"
"github.com/janderland/fql/keyval"
"github.com/janderland/fql/keyval/values"
)

type (
// ValHandler processes the FDB value byte-strings during a FDBQ
// ValHandler processes the FDB value byte-strings during a FQL
// read operation. Depending on the operation, the byte-strings
// aren't always deserialized.
ValHandler interface {
Expand Down
2 changes: 1 addition & 1 deletion engine/internal/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/binary"
"testing"

q "github.com/janderland/fdbq/keyval"
q "github.com/janderland/fql/keyval"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion engine/internal/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/apple/foundationdb/bindings/go/src/fdb"
"github.com/apple/foundationdb/bindings/go/src/fdb/directory"
"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fql/engine/facade"
"github.com/pkg/errors"
"github.com/rs/zerolog"
)
Expand Down
6 changes: 3 additions & 3 deletions engine/stream/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/apple/foundationdb/bindings/go/src/fdb"
"github.com/apple/foundationdb/bindings/go/src/fdb/directory"

"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fdbq/engine/stream"
"github.com/janderland/fdbq/keyval"
"github.com/janderland/fql/engine/facade"
"github.com/janderland/fql/engine/stream"
"github.com/janderland/fql/keyval"
)

func Example() {
Expand Down
12 changes: 6 additions & 6 deletions engine/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"github.com/pkg/errors"
"github.com/rs/zerolog"

"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fdbq/engine/internal"
"github.com/janderland/fdbq/keyval"
"github.com/janderland/fdbq/keyval/compare"
"github.com/janderland/fdbq/keyval/convert"
"github.com/janderland/fql/engine/facade"
"github.com/janderland/fql/engine/internal"
"github.com/janderland/fql/keyval"
"github.com/janderland/fql/keyval/compare"
"github.com/janderland/fql/keyval/convert"
)

type (
Expand Down Expand Up @@ -159,7 +159,7 @@ func (x *Stream) ReadRange(tr facade.ReadTransaction, query keyval.Tuple, opts R
// UnpackKeys converts the channel of DirKVErr into a channel of KeyValErr in a separate goroutine.
// When the goroutine exits, the returned channel is closed. Any errors read from the input channel
// are wrapped and forwarded. Keys are unpacked using subspace.Subspace.Unpack and then converted to
// FDBQ types. Values are converted to [keyval.Bytes]; the actual byte string remains unchanged.
// FQL types. Values are converted to [keyval.Bytes]; the actual byte string remains unchanged.
func (x *Stream) UnpackKeys(query keyval.Tuple, filter bool, in chan DirKVErr) chan KeyValErr {
out := make(chan KeyValErr)

Expand Down
10 changes: 5 additions & 5 deletions engine/stream/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"

"github.com/janderland/fdbq/engine/facade"
"github.com/janderland/fdbq/engine/internal"
q "github.com/janderland/fdbq/keyval"
"github.com/janderland/fdbq/keyval/convert"
"github.com/janderland/fdbq/keyval/values"
"github.com/janderland/fql/engine/facade"
"github.com/janderland/fql/engine/internal"
q "github.com/janderland/fql/keyval"
"github.com/janderland/fql/keyval/convert"
"github.com/janderland/fql/keyval/values"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/janderland/fdbq
module github.com/janderland/fql

go 1.19

Expand Down
Loading

0 comments on commit eb36099

Please sign in to comment.