From 24046666a24a07ff2b4464471ad94d831fc10e55 Mon Sep 17 00:00:00 2001
From: Jon Anderson FQL is specified as a context-free
- grammar. The queries look like key-values encoded using the
- directory & tuple layers. FQL is specified as a context-free grammar.
+ The queries look like key-values encoded using the directory &
+ tuple layers. FQL queries may define a single key-value to be written, as shown
above, or may define a set of key-values to be read, as shown
@@ -176,10 +176,10 @@ FQL
Encoding
@@ -63,10 +63,10 @@
FQL
Overview
- /my/directory("my","tuple")=4000
Data Elements
between -1.18e4932
and 1.18e4932
, and may
use scientific notation. The type may also be instantiated as the
tokens -inf
, inf
, -nan
, or
- nan
. The element is represented as an 80-bit extended
- double floating-point and will snap to the nearest representable
- number.
nan
. The element is represented as an 80-bit extended
+ double floating-point
+ and will snap to the nearest representable number.
/float(-inf,nan)=1.234e4732
The str
type is the only element type allowed in
directory paths. If a directory string only contains alphanumericals,
@@ -297,8 +297,6 @@
❓ Currently, the ...
token is only allowed as the
last element of a tuple. This will be revisited in the future.
TODO: Write this section.
Whitespace and newlines are allowed within a tuple, between its elements.
@@ -315,6 +313,8 @@TODO: Write this section.
FQL queries can mutate a single key-value, read one or more key-values, or list directories. Throughout this section, snippets of @@ -558,10 +558,8 @@
Besides basic CRUD - operations, FQL is capable of performing indirection and aggregation - queries.
+Besides basic CRUD operations, FQL is capable of performing + indirection and aggregation queries.
🚧 Indirection is still being implemented.
@@ -605,10 +603,11 @@Aggregation
Aggregation queries read multiple key-values and combine them into a single output key-value.
-Foundation DB performs best when key-values are kept small. When storing large - blobs, the blobs are usually split into 10 kB chunks and stored as - values. The respective keys contain the byte offset of the chunks.
+Foundation DB performs best when key-values are kept small. When + storing large blobs, the + blobs are usually split into 10 kB chunks and stored as values. The + respective keys contain the byte offset of the chunks.
/blob(
"audio.wav", % The identifier of the blob.
<offset:int>, % The byte offset within the blob.
@@ -665,7 +664,7 @@ Using FQL
exploring the data, similar to psql
for Postgres. This
libraries powering this application are exposed as a Go API, allowing
FQL to be used as a Foundation DB layer.
+ href="https://apple.github.io/foundationdb/layer-concept.html">layer;
Command Line
Headless
diff --git a/docs/index.md b/docs/index.md
index 635769b..ac2d38d 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -24,11 +24,12 @@ include-before: |
# Overview
-FQL is specified as a [context-free
-grammar](https://github.com/janderland/fql/blob/main/syntax.ebnf).
-The queries look like key-values encoded using the directory
+FQL is specified as a context-free [grammar][]. The
+queries look like key-values encoded using the directory
& tuple layers.
+[grammar]: https://github.com/janderland/fql/blob/main/syntax.ebnf
+
```language-fql {.query}
/my/directory("my","tuple")=4000
```
@@ -123,8 +124,9 @@ a directory path.
# Data Elements
An FQL query contains instances of data elements. These
-mirror the types of elements found in the [tuple
-layer](https://github.com/apple/foundationdb/blob/main/design/tuple.md).
+mirror the types of elements found in the [tuple layer][].
+
+[tuple layer]: https://github.com/apple/foundationdb/blob/main/design/tuple.md
@@ -153,9 +155,10 @@ The `num` type may be instantiated as any real number
between `-1.18e4932` and `1.18e4932`, and may use scientific
notation. The type may also be instantiated as the tokens
`-inf`, `inf`, `-nan`, or `nan`. The element is represented
-as an 80-bit [extended double
-floating-point](https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format)
-and will snap to the nearest representable number.
+as an 80-bit extended double [floating-point][] and will
+snap to the nearest representable number.
+
+[floating-point]: https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format
```language-fql {.query}
/float(-inf,nan)=1.234e4732
@@ -303,10 +306,6 @@ any type.
> ❓ Currently, the `...` token is only allowed as the last
> element of a tuple. This will be revisited in the future.
-# Options
-
-TODO: Write this section.
-
# Space & Comments
Whitespace and newlines are allowed within a tuple, between
@@ -332,6 +331,10 @@ line. They can be used to describe a tuple's elements.
)= % balance in USD
```
+# Options
+
+TODO: Write this section.
+
# Basic Queries
FQL queries can mutate a single key-value, read one or more
@@ -642,10 +645,8 @@ db.ReadTransact(func(tr fdb.ReadTransaction) (interface{}, error) {
# Advanced Queries
-Besides basic
-[CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete)
-operations, FQL is capable of performing indirection and
-aggregation queries.
+Besides basic CRUD operations, FQL is capable of performing
+indirection and aggregation queries.
## Indirection
@@ -716,11 +717,11 @@ Aggregation queries read multiple key-values and combine
them into a single output key-value.
Foundation DB performs best when key-values are kept small.
-When [storing large
-blobs](https://apple.github.io/foundationdb/blob.html), the
-blobs are usually split into 10 kB chunks and stored as
-values. The respective keys contain the byte offset of the
-chunks.
+When storing large [blobs][], the blobs are usually split
+into 10 kB chunks and stored as values. The respective keys
+contain the byte offset of the chunks.
+
+[blobs]: https://apple.github.io/foundationdb/blob.html
```language-fql {.query}
/blob(
@@ -774,8 +775,9 @@ The FQL project provides an application for executing
queries and exploring the data, similar to `psql` for
Postgres. This libraries powering this application are
exposed as a Go API, allowing FQL to be used as a Foundation
-DB
-[layer](https://apple.github.io/foundationdb/layer-concept.html).
+DB [layer][];
+
+[layer]: https://apple.github.io/foundationdb/layer-concept.html
## Command Line