alf-shell 0.16.3 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +6 -6
- data/doc/man/alf-explain.man +1 -1
- data/doc/man/alf-metadata.man +1 -1
- data/doc/man/alf-repl.man +3 -3
- data/doc/man/alf-show.man +2 -2
- data/doc/man/alf.man +15 -15
- data/doc/man/allbut.man +1 -1
- data/doc/man/among.man +1 -1
- data/doc/man/avg.man +2 -2
- data/doc/man/between.man +1 -1
- data/doc/man/concat.man +2 -2
- data/doc/man/contradiction.man +2 -2
- data/doc/man/count.man +1 -1
- data/doc/man/eq.man +2 -2
- data/doc/man/extend.man +3 -3
- data/doc/man/frame.man +1 -1
- data/doc/man/group.man +2 -2
- data/doc/man/gt.man +2 -2
- data/doc/man/gte.man +2 -2
- data/doc/man/image.man +2 -2
- data/doc/man/intersect.man +1 -1
- data/doc/man/join.man +2 -2
- data/doc/man/lt.man +2 -2
- data/doc/man/lte.man +2 -2
- data/doc/man/matching.man +1 -1
- data/doc/man/max.man +2 -2
- data/doc/man/min.man +2 -2
- data/doc/man/minus.man +1 -1
- data/doc/man/native.man +2 -2
- data/doc/man/neq.man +2 -2
- data/doc/man/not_matching.man +1 -1
- data/doc/man/page.man +4 -4
- data/doc/man/project.man +1 -1
- data/doc/man/rank.man +1 -1
- data/doc/man/rename.man +1 -1
- data/doc/man/restrict.man +2 -2
- data/doc/man/stddev.man +2 -2
- data/doc/man/sum.man +2 -2
- data/doc/man/summarize.man +1 -1
- data/doc/man/tautology.man +2 -2
- data/doc/man/ungroup.man +1 -1
- data/doc/man/union.man +1 -1
- data/doc/man/unwrap.man +2 -2
- data/doc/man/variance.man +2 -2
- data/doc/man/wrap.man +1 -1
- data/doc/txt/{alf-explain.man → alf-explain.txt} +0 -0
- data/doc/txt/{alf-metadata.man → alf-metadata.txt} +0 -0
- data/doc/txt/{alf-repl.man → alf-repl.txt} +0 -0
- data/doc/txt/{alf-show.man → alf-show.txt} +0 -0
- data/doc/txt/{alf.man → alf.txt} +0 -0
- data/lib/alf/shell/version.rb +1 -1
- metadata +15 -15
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
alf-shell (0.16.
|
|
5
|
-
alf-core (
|
|
4
|
+
alf-shell (0.16.4)
|
|
5
|
+
alf-core (~> 0.16)
|
|
6
6
|
highline (~> 1.6)
|
|
7
7
|
quickl (~> 0.4.3)
|
|
8
8
|
|
|
9
9
|
PATH
|
|
10
10
|
remote: ../alf-core
|
|
11
11
|
specs:
|
|
12
|
-
alf-core (0.
|
|
12
|
+
alf-core (0.17.0)
|
|
13
13
|
domain (~> 1.0)
|
|
14
14
|
myrrha (~> 3.0)
|
|
15
15
|
path (~> 1.3)
|
|
@@ -18,8 +18,8 @@ PATH
|
|
|
18
18
|
PATH
|
|
19
19
|
remote: ../alf-doc
|
|
20
20
|
specs:
|
|
21
|
-
alf-doc (0.
|
|
22
|
-
alf-core (= 0.
|
|
21
|
+
alf-doc (0.17.0)
|
|
22
|
+
alf-core (= 0.17.0)
|
|
23
23
|
|
|
24
24
|
GEM
|
|
25
25
|
remote: http://rubygems.org/
|
|
@@ -27,7 +27,7 @@ GEM
|
|
|
27
27
|
diff-lcs (1.2.5)
|
|
28
28
|
domain (1.0.0)
|
|
29
29
|
highline (1.6.21)
|
|
30
|
-
myrrha (3.
|
|
30
|
+
myrrha (3.1.0)
|
|
31
31
|
domain (~> 1.0)
|
|
32
32
|
path (1.3.3)
|
|
33
33
|
quickl (0.4.3)
|
data/doc/man/alf-explain.man
CHANGED
data/doc/man/alf-metadata.man
CHANGED
|
@@ -10,4 +10,4 @@ This command prints some metadata (e.g. heading, keys, etc.) about the
|
|
|
10
10
|
expression passed as first argument.
|
|
11
11
|
.SH Example
|
|
12
12
|
.PP
|
|
13
|
-
\fB\fCalf\fR \fB\fC
|
|
13
|
+
\fB\fCalf\fR \fB\fC--examples\fR metadata "restrict(suppliers, city: 'London')"
|
data/doc/man/alf-repl.man
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Launches Alf's Read\-Eval\-Print\-Loop (REPL) web application.
|
|
4
4
|
.SH Synopsis
|
|
5
5
|
.PP
|
|
6
|
-
\fB\fCalf\fR [\fB\fC
|
|
6
|
+
\fB\fCalf\fR [\fB\fC--db=...\fR] repl
|
|
7
7
|
.SH Description
|
|
8
8
|
.PP
|
|
9
9
|
This command launches the REPL in the current data context defined by the
|
|
10
|
-
\fB\fC
|
|
10
|
+
\fB\fC.alfrc\fR file and common alf options (e.g. \fB\fC--db\fR).
|
|
11
11
|
.SH Example
|
|
12
12
|
.PP
|
|
13
|
-
\fB\fCalf\fR \fB\fC
|
|
13
|
+
\fB\fCalf\fR \fB\fC--db=postgres://...\fR repl
|
data/doc/man/alf-show.man
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Evaluates a query and shows the result.
|
|
4
4
|
.SH Synopsis
|
|
5
5
|
.PP
|
|
6
|
-
\fB\fCalf\fR [\fB\fC
|
|
6
|
+
\fB\fCalf\fR [\fB\fC--csv\fR|\fB\fC--json\fR\&...] show \fIQUERY\fP \-\- [\fIORDERING\fP]
|
|
7
7
|
.SH Description
|
|
8
8
|
.PP
|
|
9
9
|
Take a query argument and execute it against the current database (according
|
|
@@ -13,4 +13,4 @@ output. The format (e.g. json) may be specified through \fB\fCalf\fR main option
|
|
|
13
13
|
When an ordering is specified, tuples are rendered in the order specified.
|
|
14
14
|
.SH Example
|
|
15
15
|
.PP
|
|
16
|
-
\fB\fCalf\fR \fB\fC
|
|
16
|
+
\fB\fCalf\fR \fB\fC--examples\fR show "restrict(suppliers, city: 'London')" \-\- name DESC
|
data/doc/man/alf.man
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Relational algebra at your fingertips
|
|
4
4
|
.SH Synopsis
|
|
5
5
|
.PP
|
|
6
|
-
\fB\fCalf\fR [\fB\fC
|
|
6
|
+
\fB\fCalf\fR [\fB\fC--version\fR] [\fB\fC--help\fR]
|
|
7
7
|
.PP
|
|
8
8
|
\fB\fCalf\fR \fIFILE.alf\fP
|
|
9
9
|
.PP
|
|
@@ -14,49 +14,49 @@ Relational algebra at your fingertips
|
|
|
14
14
|
\fB\fCalf\fR help \fIOPERATOR\fP
|
|
15
15
|
.SH Options
|
|
16
16
|
.TP
|
|
17
|
-
\fB\fC
|
|
17
|
+
\fB\fC--rash\fR
|
|
18
18
|
Render output as ruby hashes
|
|
19
19
|
.TP
|
|
20
|
-
\fB\fC
|
|
20
|
+
\fB\fC--text\fR
|
|
21
21
|
Render output as a text table
|
|
22
22
|
.TP
|
|
23
|
-
\fB\fC
|
|
23
|
+
\fB\fC--yaml\fR
|
|
24
24
|
Render output in YAML
|
|
25
25
|
.TP
|
|
26
|
-
\fB\fC
|
|
26
|
+
\fB\fC--json\fR
|
|
27
27
|
Render output in JSON
|
|
28
28
|
.TP
|
|
29
|
-
\fB\fC
|
|
29
|
+
\fB\fC--csv\fR
|
|
30
30
|
Render output in CSV
|
|
31
31
|
.TP
|
|
32
|
-
\fB\fC
|
|
32
|
+
\fB\fC--examples\fR
|
|
33
33
|
Use the suppliers and parts example database
|
|
34
34
|
.TP
|
|
35
|
-
\fB\fC
|
|
35
|
+
\fB\fC--db=DB\fR
|
|
36
36
|
Set the database (adapter) to use. Recognized values can be
|
|
37
37
|
folders with recognized files, or an URL to a SQL database
|
|
38
38
|
(e.g. postgres://user:pass@host/database)
|
|
39
39
|
.TP
|
|
40
|
-
\fB\fC
|
|
40
|
+
\fB\fC--stdin=READER\fR
|
|
41
41
|
Specify the kind of reader when reading on standard input
|
|
42
42
|
(i.e. rash, csv, json, ruby, or yaml)
|
|
43
43
|
.TP
|
|
44
|
-
\fB\fC
|
|
44
|
+
\fB\fC-Idirectory\fR
|
|
45
45
|
Specify $LOAD_PATH directory (may be used more than once)
|
|
46
46
|
.TP
|
|
47
|
-
\fB\fC
|
|
47
|
+
\fB\fC-rlibrary\fR
|
|
48
48
|
Require the specified ruby library, before executing alf
|
|
49
49
|
.TP
|
|
50
|
-
\fB\fC
|
|
50
|
+
\fB\fC--ff=FORMAT\fR
|
|
51
51
|
Specify the floating point format
|
|
52
52
|
.TP
|
|
53
|
-
\fB\fC
|
|
53
|
+
\fB\fC--[no-]pretty\fR
|
|
54
54
|
Enable/disable pretty print best effort
|
|
55
55
|
.TP
|
|
56
|
-
\fB\fC
|
|
56
|
+
\fB\fC-h\fR, \fB\fC--help\fR
|
|
57
57
|
Show this help
|
|
58
58
|
.TP
|
|
59
|
-
\fB\fC
|
|
59
|
+
\fB\fC-v\fR, \fB\fC--version\fR
|
|
60
60
|
Show version and copyright
|
|
61
61
|
.SH Commands
|
|
62
62
|
.TP
|
data/doc/man/allbut.man
CHANGED
data/doc/man/among.man
CHANGED
data/doc/man/avg.man
CHANGED
|
@@ -5,7 +5,7 @@ Average
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
avg(expr: AttrName|(Tuple
|
|
8
|
+
avg(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ avg{|t| t.qty * t.price }
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
avg(
|
|
27
|
+
avg(->(t){ t.qty * t.price })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/between.man
CHANGED
data/doc/man/concat.man
CHANGED
|
@@ -5,7 +5,7 @@ String concatenation
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
concat(expr: AttrName|(Tuple
|
|
8
|
+
concat(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -30,7 +30,7 @@ concat(between: ', '){|t| t.name }
|
|
|
30
30
|
.PP
|
|
31
31
|
.RS
|
|
32
32
|
.nf
|
|
33
|
-
concat(
|
|
33
|
+
concat(->(t){ t.name.upcase }, between: ', ')
|
|
34
34
|
.fi
|
|
35
35
|
.RE
|
|
36
36
|
.SH Description
|
data/doc/man/contradiction.man
CHANGED
|
@@ -5,7 +5,7 @@ FALSE
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
contradiction()
|
|
8
|
+
contradiction() -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -23,4 +23,4 @@ contradiction
|
|
|
23
23
|
.RE
|
|
24
24
|
.SH Description
|
|
25
25
|
.PP
|
|
26
|
-
This predicate always return false. It is equivalent to \fB\fC
|
|
26
|
+
This predicate always return false. It is equivalent to \fB\fC->(t){ false }\fR\&.
|
data/doc/man/count.man
CHANGED
data/doc/man/eq.man
CHANGED
|
@@ -5,7 +5,7 @@ Equals to
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
eq(left: Alpha|AttrName, right: Alpha|AttrName)
|
|
8
|
+
eq(left: Alpha|AttrName, right: Alpha|AttrName) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -26,4 +26,4 @@ eq(:supplier_city, :part_city)
|
|
|
26
26
|
This predicates checks whether two values are equal.
|
|
27
27
|
.SH Implementation notes
|
|
28
28
|
.PP
|
|
29
|
-
This predicate is equivalent to \fB\fC
|
|
29
|
+
This predicate is equivalent to \fB\fC->(t){ _left_ == _right_ }\fR\&.
|
data/doc/man/extend.man
CHANGED
|
@@ -5,7 +5,7 @@ Extends input tuples with derived/computed attributes
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
extend(operand: Relation, ext: TupleComputation)
|
|
8
|
+
extend(operand: Relation, ext: TupleComputation) -> Relation
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -13,8 +13,8 @@ extend(operand: Relation, ext: TupleComputation) \-> Relation
|
|
|
13
13
|
.RS
|
|
14
14
|
.nf
|
|
15
15
|
extend(suppliers,
|
|
16
|
-
big:
|
|
17
|
-
small:
|
|
16
|
+
big: ->(t){ t.name.upcase },
|
|
17
|
+
small: ->(t){ t.name.downcase })
|
|
18
18
|
.fi
|
|
19
19
|
.RE
|
|
20
20
|
.SH Description
|
data/doc/man/frame.man
CHANGED
data/doc/man/group.man
CHANGED
|
@@ -5,7 +5,7 @@ Relation\-valued attribute
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
group(operand: Relation, attributes: AttrList, as: AttrName)
|
|
8
|
+
group(operand: Relation, attributes: AttrList, as: AttrName) -> Relation
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -33,7 +33,7 @@ This operator could be formally defined as the following shortcut:
|
|
|
33
33
|
def group(operand, attributes, as)
|
|
34
34
|
extend(
|
|
35
35
|
allbut(operand, attributes),
|
|
36
|
-
as:
|
|
36
|
+
as: ->(t){ project(matching(operand,
|
|
37
37
|
.BR Relation (t)),
|
|
38
38
|
attributes) })
|
|
39
39
|
end
|
data/doc/man/gt.man
CHANGED
|
@@ -5,7 +5,7 @@ Greater than
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
gt(left: Alpha|AttrName, right: Alpha|AttrName)
|
|
8
|
+
gt(left: Alpha|AttrName, right: Alpha|AttrName) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -27,4 +27,4 @@ This predicates checks whether a value (\fB\fCleft\fR) is greater than another
|
|
|
27
27
|
one (\fB\fCright\fR).
|
|
28
28
|
.SH Implementation notes
|
|
29
29
|
.PP
|
|
30
|
-
This predicate is equivalent to \fB\fC
|
|
30
|
+
This predicate is equivalent to \fB\fC->(t){ _left_ > _right_ }\fR\&.
|
data/doc/man/gte.man
CHANGED
|
@@ -5,7 +5,7 @@ Greater than or equal to
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
gte(left: Alpha|AttrName, right: Alpha|AttrName)
|
|
8
|
+
gte(left: Alpha|AttrName, right: Alpha|AttrName) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -27,4 +27,4 @@ This predicates checks whether a value (\fB\fCleft\fR) is greater than or equal
|
|
|
27
27
|
to another one (\fB\fCright\fR).
|
|
28
28
|
.SH Implementation notes
|
|
29
29
|
.PP
|
|
30
|
-
This predicate is equivalent to \fB\fC
|
|
30
|
+
This predicate is equivalent to \fB\fC->(t){ _left_ >= _right_ }\fR\&.
|
data/doc/man/image.man
CHANGED
|
@@ -6,7 +6,7 @@ tuple in the right relation.
|
|
|
6
6
|
.PP
|
|
7
7
|
.RS
|
|
8
8
|
.nf
|
|
9
|
-
image(left: Relation, right: Relation, as: AttrName)
|
|
9
|
+
image(left: Relation, right: Relation, as: AttrName) -> Relation
|
|
10
10
|
.fi
|
|
11
11
|
.RE
|
|
12
12
|
.SH Examples
|
|
@@ -30,7 +30,7 @@ expression:
|
|
|
30
30
|
.RS
|
|
31
31
|
.nf
|
|
32
32
|
def image(left, right, as)
|
|
33
|
-
extend(left, as =>
|
|
33
|
+
extend(left, as => ->(t){
|
|
34
34
|
allbut(
|
|
35
35
|
matching(right,
|
|
36
36
|
.BR Relation (t)),
|
data/doc/man/intersect.man
CHANGED
data/doc/man/join.man
CHANGED
|
@@ -5,7 +5,7 @@ Natural join
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
join(left: Relation, right: Relation)
|
|
8
|
+
join(left: Relation, right: Relation) -> Relation
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -75,7 +75,7 @@ Alternatively, shortcuts can be considered. A (advanced) example below:
|
|
|
75
75
|
# before joining.
|
|
76
76
|
def join_on(left, right, wish)
|
|
77
77
|
commons = left.attr_list & right.attr_list
|
|
78
|
-
join(left, allbut(right, commons
|
|
78
|
+
join(left, allbut(right, commons - wish))
|
|
79
79
|
end
|
|
80
80
|
# observe here how part names have been discarded to avoid joining them
|
|
81
81
|
# with supplier names (empty result guaranteed)
|
data/doc/man/lt.man
CHANGED
|
@@ -5,7 +5,7 @@ Less than
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
lt(left: Alpha|AttrName, right: Alpha|AttrName)
|
|
8
|
+
lt(left: Alpha|AttrName, right: Alpha|AttrName) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -27,4 +27,4 @@ This predicates checks whether a value (\fB\fCleft\fR) is less than another one
|
|
|
27
27
|
(\fB\fCright\fR).
|
|
28
28
|
.SH Implementation notes
|
|
29
29
|
.PP
|
|
30
|
-
This predicate is equivalent to \fB\fC
|
|
30
|
+
This predicate is equivalent to \fB\fC->(t){ _left_ < _right_ }\fR\&.
|
data/doc/man/lte.man
CHANGED
|
@@ -5,7 +5,7 @@ Less than or equal to
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
lte(left: Alpha|AttrName, right: Alpha|AttrName)
|
|
8
|
+
lte(left: Alpha|AttrName, right: Alpha|AttrName) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -27,4 +27,4 @@ This predicates checks whether a value (\fB\fCleft\fR) is less than or equal to
|
|
|
27
27
|
another one (\fB\fCright\fR).
|
|
28
28
|
.SH Implementation notes
|
|
29
29
|
.PP
|
|
30
|
-
This predicate is equivalent to \fB\fC
|
|
30
|
+
This predicate is equivalent to \fB\fC->(t){ _left_ <= _right_ }\fR\&.
|
data/doc/man/matching.man
CHANGED
data/doc/man/max.man
CHANGED
|
@@ -5,7 +5,7 @@ Maximal value
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
max(expr: AttrName|(Tuple
|
|
8
|
+
max(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ max{|t| t.qty * t.price }
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
max(
|
|
27
|
+
max(->(t){ t.qty * t.price })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/min.man
CHANGED
|
@@ -5,7 +5,7 @@ Minimal value
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
min(expr: AttrName|(Tuple
|
|
8
|
+
min(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ min{|t| t.qty * t.price }
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
min(
|
|
27
|
+
min(->(t){ t.qty * t.price })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/minus.man
CHANGED
data/doc/man/native.man
CHANGED
|
@@ -5,14 +5,14 @@ User\-defined tuple predicate
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
native(predicate: (Tuple
|
|
8
|
+
native(predicate: (Tuple -> Boolean)) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
12
12
|
.PP
|
|
13
13
|
.RS
|
|
14
14
|
.nf
|
|
15
|
-
|
|
15
|
+
->(t){ t.city == 'London' }
|
|
16
16
|
.fi
|
|
17
17
|
.RE
|
|
18
18
|
.SH Description
|
data/doc/man/neq.man
CHANGED
|
@@ -5,7 +5,7 @@ Not equal to
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
neq(left: Alpha|AttrName, right: Alpha|AttrName)
|
|
8
|
+
neq(left: Alpha|AttrName, right: Alpha|AttrName) -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -26,4 +26,4 @@ neq(:supplier_city, :part_city)
|
|
|
26
26
|
This predicates checks whether two values are different.
|
|
27
27
|
.SH Implementation notes
|
|
28
28
|
.PP
|
|
29
|
-
This predicate is equivalent to \fB\fC
|
|
29
|
+
This predicate is equivalent to \fB\fC->(t){ _left_ != _right_ }\fR\&.
|
data/doc/man/not_matching.man
CHANGED
data/doc/man/page.man
CHANGED
|
@@ -5,7 +5,7 @@ Pagination
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
page(operand: Relation, ordering: Ordering, nth: Integer)
|
|
8
|
+
page(operand: Relation, ordering: Ordering, nth: Integer) -> Relation
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -18,7 +18,7 @@ page(suppliers, [:status, :sid], 1, page_size: 3)
|
|
|
18
18
|
.PP
|
|
19
19
|
.RS
|
|
20
20
|
.nf
|
|
21
|
-
page(suppliers, [:status, :sid],
|
|
21
|
+
page(suppliers, [:status, :sid], -1, page_size: 3)
|
|
22
22
|
.fi
|
|
23
23
|
.RE
|
|
24
24
|
.SH Description
|
|
@@ -28,7 +28,7 @@ belonging to the \fB\fCnth\fR page (starting at 1). When \fB\fCnth\fR is negativ
|
|
|
28
28
|
tuples that belong to the \fB\fCnth\fR page from the end (e.g., \-1 is last page).
|
|
29
29
|
.PP
|
|
30
30
|
Formally, the page is defined by those tuples whose ranking according to
|
|
31
|
-
\fB\fCorder\fR is such that \fB\fC(nth
|
|
31
|
+
\fB\fCorder\fR is such that \fB\fC(nth-1)*page_size <= rank < nth*page_size\fR\&. In other
|
|
32
32
|
words, this operator is almost equivalent to the following definition
|
|
33
33
|
(ignoring negative page indexes for simplicity):
|
|
34
34
|
.PP
|
|
@@ -38,7 +38,7 @@ def page(operand, order, nth, page_size)
|
|
|
38
38
|
allbut(
|
|
39
39
|
restrict(
|
|
40
40
|
rank(operand, order, :rank),
|
|
41
|
-
lte((nth
|
|
41
|
+
lte((nth-1)*page_size, :rank) & lt(:rank, nth*page_size)),
|
|
42
42
|
[:rank])
|
|
43
43
|
end
|
|
44
44
|
page(suppliers, [:status, :sid], 1, 3)
|
data/doc/man/project.man
CHANGED
data/doc/man/rank.man
CHANGED
data/doc/man/rename.man
CHANGED
data/doc/man/restrict.man
CHANGED
|
@@ -5,7 +5,7 @@ Predicate\-based filtering
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
restrict(operand: Relation, predicate: Predicate)
|
|
8
|
+
restrict(operand: Relation, predicate: Predicate) -> Relation
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ restrict(suppliers, eq(city: 'Paris') & gt(:status, 20))
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
restrict(suppliers,
|
|
27
|
+
restrict(suppliers, ->(t){ t.city == 'Paris' and t.status > 20 })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/stddev.man
CHANGED
|
@@ -5,7 +5,7 @@ Standard deviation
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
stddev(expr: AttrName|(Tuple
|
|
8
|
+
stddev(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ stddev{|t| t.qty * t.price }
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
stddev(
|
|
27
|
+
stddev(->(t){ t.qty * t.price })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/sum.man
CHANGED
|
@@ -5,7 +5,7 @@ Arithmetic sum
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
sum(expr: AttrName|(Tuple
|
|
8
|
+
sum(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ sum{|t| t.qty * t.price }
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
sum(
|
|
27
|
+
sum(->(t){ t.qty * t.price })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/summarize.man
CHANGED
data/doc/man/tautology.man
CHANGED
|
@@ -5,7 +5,7 @@ TRUE
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
tautology()
|
|
8
|
+
tautology() -> Predicate
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -23,4 +23,4 @@ tautology
|
|
|
23
23
|
.RE
|
|
24
24
|
.SH Description
|
|
25
25
|
.PP
|
|
26
|
-
This predicate always return true. It is equivalent to \fB\fC
|
|
26
|
+
This predicate always return true. It is equivalent to \fB\fC->(t){ true }\fR\&.
|
data/doc/man/ungroup.man
CHANGED
data/doc/man/union.man
CHANGED
data/doc/man/unwrap.man
CHANGED
|
@@ -5,7 +5,7 @@ Inverse of wrap
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
unwrap(operand: Relation, tva: AttrName)
|
|
8
|
+
unwrap(operand: Relation, tva: AttrName) -> Relation
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -23,7 +23,7 @@ Unwrapping of \fB\fCtva\fR on an input tuple \fB\fCt\fR consists in removing \fB
|
|
|
23
23
|
.PP
|
|
24
24
|
.RS
|
|
25
25
|
.nf
|
|
26
|
-
Tuple(x: 1, tva: Tuple(y: 2, z: 3))
|
|
26
|
+
Tuple(x: 1, tva: Tuple(y: 2, z: 3)) -> Tuple(x: 1, y: 2, z: 3)
|
|
27
27
|
.fi
|
|
28
28
|
.RE
|
|
29
29
|
.PP
|
data/doc/man/variance.man
CHANGED
|
@@ -5,7 +5,7 @@ Variance
|
|
|
5
5
|
.PP
|
|
6
6
|
.RS
|
|
7
7
|
.nf
|
|
8
|
-
variance(expr: AttrName|(Tuple
|
|
8
|
+
variance(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
|
9
9
|
.fi
|
|
10
10
|
.RE
|
|
11
11
|
.SH Examples
|
|
@@ -24,7 +24,7 @@ variance{|t| t.qty * t.price }
|
|
|
24
24
|
.PP
|
|
25
25
|
.RS
|
|
26
26
|
.nf
|
|
27
|
-
variance(
|
|
27
|
+
variance(->(t){ t.qty * t.price })
|
|
28
28
|
.fi
|
|
29
29
|
.RE
|
|
30
30
|
.SH Description
|
data/doc/man/wrap.man
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/doc/txt/{alf.man → alf.txt}
RENAMED
|
File without changes
|
data/lib/alf/shell/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alf-shell
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.16.
|
|
4
|
+
version: 0.16.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-
|
|
12
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -50,7 +50,7 @@ dependencies:
|
|
|
50
50
|
requirements:
|
|
51
51
|
- - '='
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 0.16.
|
|
53
|
+
version: 0.16.4
|
|
54
54
|
type: :development
|
|
55
55
|
prerelease: false
|
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -58,7 +58,7 @@ dependencies:
|
|
|
58
58
|
requirements:
|
|
59
59
|
- - '='
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 0.16.
|
|
61
|
+
version: 0.16.4
|
|
62
62
|
- !ruby/object:Gem::Dependency
|
|
63
63
|
name: quickl
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -96,17 +96,17 @@ dependencies:
|
|
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
|
97
97
|
none: false
|
|
98
98
|
requirements:
|
|
99
|
-
- -
|
|
99
|
+
- - ~>
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: 0.16
|
|
101
|
+
version: '0.16'
|
|
102
102
|
type: :runtime
|
|
103
103
|
prerelease: false
|
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
105
|
none: false
|
|
106
106
|
requirements:
|
|
107
|
-
- -
|
|
107
|
+
- - ~>
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 0.16
|
|
109
|
+
version: '0.16'
|
|
110
110
|
description: This project implements the `alf` commandline tool.
|
|
111
111
|
email:
|
|
112
112
|
- blambeau at gmail.com
|
|
@@ -163,11 +163,11 @@ files:
|
|
|
163
163
|
- doc/man/unwrap.man
|
|
164
164
|
- doc/man/variance.man
|
|
165
165
|
- doc/man/wrap.man
|
|
166
|
-
- doc/txt/alf-explain.
|
|
167
|
-
- doc/txt/alf-metadata.
|
|
168
|
-
- doc/txt/alf-repl.
|
|
169
|
-
- doc/txt/alf-show.
|
|
170
|
-
- doc/txt/alf.
|
|
166
|
+
- doc/txt/alf-explain.txt
|
|
167
|
+
- doc/txt/alf-metadata.txt
|
|
168
|
+
- doc/txt/alf-repl.txt
|
|
169
|
+
- doc/txt/alf-show.txt
|
|
170
|
+
- doc/txt/alf.txt
|
|
171
171
|
- doc/txt/allbut.txt
|
|
172
172
|
- doc/txt/among.txt
|
|
173
173
|
- doc/txt/avg.txt
|
|
@@ -282,7 +282,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
282
282
|
version: '0'
|
|
283
283
|
segments:
|
|
284
284
|
- 0
|
|
285
|
-
hash:
|
|
285
|
+
hash: -3355132787973744618
|
|
286
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
none: false
|
|
288
288
|
requirements:
|
|
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
291
291
|
version: '0'
|
|
292
292
|
segments:
|
|
293
293
|
- 0
|
|
294
|
-
hash:
|
|
294
|
+
hash: -3355132787973744618
|
|
295
295
|
requirements: []
|
|
296
296
|
rubyforge_project:
|
|
297
297
|
rubygems_version: 1.8.25
|