Skip to content

Commit

Permalink
Version 1.5.0, Comments, math functions, strict semicolon usage (#358)
Browse files Browse the repository at this point in the history
* move to .io

* Compat with missing ";"

* log

* Implement math functions

* Upd Release build, fix collection func test, up dockerfile
  • Loading branch information
joente authored Jan 21, 2024
1 parent f454adf commit 5e7797f
Show file tree
Hide file tree
Showing 101 changed files with 5,843 additions and 255 deletions.
27 changes: 19 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# v1.5.0

* Comments can be placed anywhere that whitespace is allowed.
* Comments are no longer stored within closures. This behavior was previously
partially enforced, and now it is strictly followed.
* Statements must be separated with semicolons. Syntax checking is now more strict.
* Removed syntax option for selecting a collection scope by Id.
* Separate collection Id from collection root Id.
* The collection Id and collection root Id no longer need to be equal.
* Added `next_free_id` field to collection info and removed from nodes info.
_(`node_info()` still contains `next_free_id` for the global free Id)_
_(The response for `node_info()` still contains the `next_free_id` for the global free Id)_
* Added `dump` option to the `export(..)` function for a full collection export.
* Added function `import()` which can import a collection export dump.
* Added function `root()` for getting the collection root as thing.
* Function `export(..)` can no longer be used in a query with a change.
* Fixed a bug with adding enumerators to a restricted list.
* Fixed a bug with applying a new relation on existing data.
* Rename change._tasks in C code, no user impact.
* Function `export(..)` can no longer be used in queries with changes.
* A bug with adding enumerators to restricted lists has been fixed.
* A bug with applying a new relation to existing data has been fixed.
* The `change._tasks` structure in C code has been renamed.
This has no impact on user-facing functionality.
* Replaced Docker images _(both tests and builds)_ with newer versions.
* Removed `ti_pkg_check` hack for old compilers _(no longer required with recent compilers)_.
* Added `INT_MIN` and `INT_MAX` fixed keywords with corresponding values.
* Removed `ti_pkg_check` hack for old compilers. _(this is no longer required with recent compilers)_
* Added integer minimun `INT_MIN` and maximum `INT_MAX` constants with corresponding values.
* The primary domain for the ThingsDB website has been changed from `.net` to `.io`.
* Several new mathematical functions have been added: `abs(..)`, `ceil(..)`,
`cos(..)`, `exp()..`, `floor(..)`, `log10(..)`, `log2(..)`, `loge(..)`,
`pow(..)`, `sin(..)`, `sqrt(..)` and `tan(..)`.
* Added mathematical constants `MATH_E` and `MATH_PI` with corresponding values.
* libcleri is now integrated into the core ThingsDB codebase, eliminating the need for separate installation.

# v1.4.16

Expand Down
1 change: 1 addition & 0 deletions Debug/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RM := rm -rf
-include src/ti/mod/subdir.mk
-include src/ti/subdir.mk
-include src/langdef/subdir.mk
-include src/cleri/subdir.mk
-include src/subdir.mk
-include inc/msgpack/subdir.mk
-include inc/lib/subdir.mk
Expand Down
2 changes: 1 addition & 1 deletion Debug/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

USER_OBJS :=

LIBS := -luv -lpcre2-8 -lcleri -lm -lyajl -lcurl
LIBS := -luv -lpcre2-8 -lm -lyajl -lcurl

1 change: 1 addition & 0 deletions Debug/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SUBDIRS := \
inc/lib \
inc/msgpack \
. \
src/cleri \
src \
src/langdef \
src/ti \
Expand Down
87 changes: 87 additions & 0 deletions Debug/src/cleri/subdir.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/cleri/choice.c \
../src/cleri/cleri.c \
../src/cleri/dup.c \
../src/cleri/expecting.c \
../src/cleri/grammar.c \
../src/cleri/keyword.c \
../src/cleri/kwcache.c \
../src/cleri/list.c \
../src/cleri/node.c \
../src/cleri/olist.c \
../src/cleri/optional.c \
../src/cleri/parse.c \
../src/cleri/prio.c \
../src/cleri/ref.c \
../src/cleri/regex.c \
../src/cleri/repeat.c \
../src/cleri/rule.c \
../src/cleri/sequence.c \
../src/cleri/this.c \
../src/cleri/token.c \
../src/cleri/tokens.c \
../src/cleri/version.c

OBJS += \
./src/cleri/choice.o \
./src/cleri/cleri.o \
./src/cleri/dup.o \
./src/cleri/expecting.o \
./src/cleri/grammar.o \
./src/cleri/keyword.o \
./src/cleri/kwcache.o \
./src/cleri/list.o \
./src/cleri/node.o \
./src/cleri/olist.o \
./src/cleri/optional.o \
./src/cleri/parse.o \
./src/cleri/prio.o \
./src/cleri/ref.o \
./src/cleri/regex.o \
./src/cleri/repeat.o \
./src/cleri/rule.o \
./src/cleri/sequence.o \
./src/cleri/this.o \
./src/cleri/token.o \
./src/cleri/tokens.o \
./src/cleri/version.o

C_DEPS += \
./src/cleri/choice.d \
./src/cleri/cleri.d \
./src/cleri/dup.d \
./src/cleri/expecting.d \
./src/cleri/grammar.d \
./src/cleri/keyword.d \
./src/cleri/kwcache.d \
./src/cleri/list.d \
./src/cleri/node.d \
./src/cleri/olist.d \
./src/cleri/optional.d \
./src/cleri/parse.d \
./src/cleri/prio.d \
./src/cleri/ref.d \
./src/cleri/regex.d \
./src/cleri/repeat.d \
./src/cleri/rule.d \
./src/cleri/sequence.d \
./src/cleri/this.d \
./src/cleri/token.d \
./src/cleri/tokens.d \
./src/cleri/version.d


# Each subdirectory must supply rules for building sources it contributes
src/cleri/%.o: ../src/cleri/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -std=gnu11 -I../inc -O0 -g3 -Wall -Wextra -c -fmessage-length=0 -march=native -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '


3 changes: 3 additions & 0 deletions Debug/src/langdef/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/langdef/compat.c \
../src/langdef/langdef.c \
../src/langdef/translate.c

OBJS += \
./src/langdef/compat.o \
./src/langdef/langdef.o \
./src/langdef/translate.o

C_DEPS += \
./src/langdef/compat.d \
./src/langdef/langdef.d \
./src/langdef/translate.d

Expand Down
1 change: 1 addition & 0 deletions Release/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RM := rm -rf
-include src/ti/mod/subdir.mk
-include src/ti/subdir.mk
-include src/langdef/subdir.mk
-include src/cleri/subdir.mk
-include src/subdir.mk
-include inc/msgpack/subdir.mk
-include inc/lib/subdir.mk
Expand Down
2 changes: 1 addition & 1 deletion Release/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

USER_OBJS :=

LIBS := -luv -lpcre2-8 -lcleri -lm -lyajl -lcurl
LIBS := -luv -lpcre2-8 -lm -lyajl -lcurl

1 change: 1 addition & 0 deletions Release/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SUBDIRS := \
inc/lib \
inc/msgpack \
. \
src/cleri \
src \
src/langdef \
src/ti \
Expand Down
87 changes: 87 additions & 0 deletions Release/src/cleri/subdir.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/cleri/choice.c \
../src/cleri/cleri.c \
../src/cleri/dup.c \
../src/cleri/expecting.c \
../src/cleri/grammar.c \
../src/cleri/keyword.c \
../src/cleri/kwcache.c \
../src/cleri/list.c \
../src/cleri/node.c \
../src/cleri/olist.c \
../src/cleri/optional.c \
../src/cleri/parse.c \
../src/cleri/prio.c \
../src/cleri/ref.c \
../src/cleri/regex.c \
../src/cleri/repeat.c \
../src/cleri/rule.c \
../src/cleri/sequence.c \
../src/cleri/this.c \
../src/cleri/token.c \
../src/cleri/tokens.c \
../src/cleri/version.c

OBJS += \
./src/cleri/choice.o \
./src/cleri/cleri.o \
./src/cleri/dup.o \
./src/cleri/expecting.o \
./src/cleri/grammar.o \
./src/cleri/keyword.o \
./src/cleri/kwcache.o \
./src/cleri/list.o \
./src/cleri/node.o \
./src/cleri/olist.o \
./src/cleri/optional.o \
./src/cleri/parse.o \
./src/cleri/prio.o \
./src/cleri/ref.o \
./src/cleri/regex.o \
./src/cleri/repeat.o \
./src/cleri/rule.o \
./src/cleri/sequence.o \
./src/cleri/this.o \
./src/cleri/token.o \
./src/cleri/tokens.o \
./src/cleri/version.o

C_DEPS += \
./src/cleri/choice.d \
./src/cleri/cleri.d \
./src/cleri/dup.d \
./src/cleri/expecting.d \
./src/cleri/grammar.d \
./src/cleri/keyword.d \
./src/cleri/kwcache.d \
./src/cleri/list.d \
./src/cleri/node.d \
./src/cleri/olist.d \
./src/cleri/optional.d \
./src/cleri/parse.d \
./src/cleri/prio.d \
./src/cleri/ref.d \
./src/cleri/regex.d \
./src/cleri/repeat.d \
./src/cleri/rule.d \
./src/cleri/sequence.d \
./src/cleri/this.d \
./src/cleri/token.d \
./src/cleri/tokens.d \
./src/cleri/version.d


# Each subdirectory must supply rules for building sources it contributes
src/cleri/%.o: ../src/cleri/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -std=gnu11 -DNDEBUG -I../inc -O3 -Wall -Wextra $(CFLAGS) -c -fmessage-length=0 -msse4.2 -finline-limit=4000 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '


3 changes: 3 additions & 0 deletions Release/src/langdef/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/langdef/compat.c \
../src/langdef/langdef.c \
../src/langdef/translate.c

OBJS += \
./src/langdef/compat.o \
./src/langdef/langdef.o \
./src/langdef/translate.o

C_DEPS += \
./src/langdef/compat.d \
./src/langdef/langdef.d \
./src/langdef/translate.d

Expand Down
7 changes: 1 addition & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ FROM amd64/alpine:3.19
COPY ./ /tmp/thingsdb/
RUN apk update && \
apk upgrade && \
apk add gcc make libuv-dev musl-dev pcre2-dev yajl-dev curl-dev util-linux-dev linux-headers git && \
git clone https://github.com/cesbit/libcleri.git /tmp/libcleri && \
cd /tmp/libcleri/Release && \
make all && \
make install && \
apk add gcc make libuv-dev musl-dev pcre2-dev yajl-dev curl-dev util-linux-dev linux-headers && \
cd /tmp/thingsdb/Release && \
make clean && \
make
Expand All @@ -16,7 +12,6 @@ RUN apk update && \
apk add pcre2 libuv yajl curl tzdata && \
mkdir -p /var/lib/thingsdb
COPY --from=0 /tmp/thingsdb/Release/thingsdb /usr/local/bin/
COPY --from=0 /usr/lib/libcleri* /usr/lib/

# Volume mounts
VOLUME ["/data"]
Expand Down
6 changes: 0 additions & 6 deletions docker/full.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ COPY ./ /tmp/thingsdb/

RUN apt-get update && apt-get install -y \
build-essential \
git \
libuv1-dev \
libpcre2-dev \
libyajl-dev \
libcurl4-nss-dev && \
git clone https://github.com/cesbit/libcleri.git /tmp/libcleri && \
cd /tmp/libcleri/Release && \
make all && \
make install && \
cd /tmp/thingsdb/Release && \
make clean && \
make
Expand All @@ -27,7 +22,6 @@ RUN mkdir -p /var/lib/thingsdb && \
pip3 install py-timod

COPY --from=0 /tmp/thingsdb/Release/thingsdb /usr/local/bin/
COPY --from=0 /usr/lib/libcleri* /usr/lib/

# Client (Socket) connections
EXPOSE 9200
Expand Down
7 changes: 1 addition & 6 deletions docker/gcloud.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ FROM amd64/alpine:3.19
COPY ./ /tmp/thingsdb/
RUN apk update && \
apk upgrade && \
apk add gcc make libuv-dev musl-dev pcre2-dev yajl-dev curl-dev util-linux-dev linux-headers git && \
git clone https://github.com/cesbit/libcleri.git /tmp/libcleri && \
cd /tmp/libcleri/Release && \
make all && \
make install && \
apk add gcc make libuv-dev musl-dev pcre2-dev yajl-dev curl-dev util-linux-dev linux-headers && \
cd /tmp/thingsdb/Release && \
make clean && \
make
Expand All @@ -16,7 +12,6 @@ RUN apk update && \
apk add pcre2 libuv yajl curl tzdata && \
mkdir -p /var/lib/thingsdb
COPY --from=0 /tmp/thingsdb/Release/thingsdb /usr/local/bin/
COPY --from=0 /usr/lib/libcleri* /usr/lib/

# Volume mounts
VOLUME ["/data"]
Expand Down
Loading

0 comments on commit 5e7797f

Please sign in to comment.