Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ It also proves that optimistic versions remain isolated when different entity
types use the same numeric ID and their mutation ledgers are merged.

```bash
make run
examples/verify-runtime-examples.sh
```

Run the command from the repository root. It builds against current reactor
sources and verifies this example together with the School bootstrap example,
using an isolated temporary SQLite database for each run.

The generated Runtime Module is installed at application startup but remains a
passive manifest. Schema reconciliation is invoked separately and explicitly.
5 changes: 5 additions & 0 deletions examples/school-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ related entities as `NotLoaded`.
Before publication, install the repository's local runtime and then run the
generated workspace. The portable SQL runtime test separately changes a constant
and verifies optimistic, single-version reconciliation.

From the repository root, run `examples/verify-runtime-examples.sh`. The gate
builds both retained examples against the current reactor sources, assigns each
run an isolated temporary SQLite database, waits for its acceptance marker, and
exits non-zero if either application fails or times out.
67 changes: 67 additions & 0 deletions examples/verify-runtime-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
set -euo pipefail

repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
run_dir="$(mktemp -d)"
active_pid=""

cleanup() {
if [[ -n "$active_pid" ]] && kill -0 "$active_pid" 2>/dev/null; then
kill "$active_pid" 2>/dev/null || true
wait "$active_pid" 2>/dev/null || true
fi
rm -rf "$run_dir"
}
trap cleanup EXIT

mvn -q -f "$repo_dir/pom.xml" \
-Pruntime-examples \
-pl examples/conformance,examples/school-management \
-am package -DskipTests

run_example() {
local name="$1"
local jar="$2"
local marker="$3"
local log="$run_dir/$name.log"
local database="$run_dir/$name.db"

java -jar "$jar" \
"--spring.datasource.url=jdbc:sqlite:$database" \
--server.port=0 >"$log" 2>&1 &
active_pid=$!

for _ in $(seq 1 240); do
if grep -Fq "$marker" "$log"; then
kill "$active_pid" 2>/dev/null || true
wait "$active_pid" 2>/dev/null || true
active_pid=""
printf 'PASS %s\n' "$name"
return 0
fi
if ! kill -0 "$active_pid" 2>/dev/null; then
wait "$active_pid" || true
active_pid=""
printf 'FAIL %s exited before its acceptance marker\n' "$name" >&2
sed -n '1,240p' "$log" >&2
return 1
fi
sleep 0.25
done

printf 'FAIL %s did not emit its acceptance marker within 60 seconds\n' "$name" >&2
sed -n '1,240p' "$log" >&2
return 1
}

run_example \
"conformance" \
"$repo_dir/examples/conformance/target/deploy/runtime-example-conformance-service-0.0.1-SNAPSHOT.jar" \
"PASS Java minimum runtime conformance: 8/8"

run_example \
"school-management" \
"$repo_dir/examples/school-management/target/deploy/school-management-service-0.0.1-SNAPSHOT.jar" \
"PASS Java School bootstrap, portable Query, and native SQLite Facet parity"

printf 'PASS Java runtime examples: 2/2\n'
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@
</plugins>
</build>

<profiles>
<profile>
<id>runtime-examples</id>
<modules>
<module>examples/school-management/lib</module>
<module>examples/school-management</module>
</modules>
</profile>
</profiles>

<repositories>
<repository>
<id>TEAQL</id>
Expand Down
19 changes: 18 additions & 1 deletion teaql-duckdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,22 @@

This module provides DuckDB support for TeaQL.

The executable compatibility gate defaults to DuckDB JDBC `1.5.5.1`:

```bash
mvn -pl teaql-duckdb test
```

An older driver can be checked with the same tests, for example:

```bash
mvn -pl teaql-duckdb clean test -Dduckdb.version=1.0.0
```

Compatibility claims refer to the Java JDBC driver exercised by this gate,
not to a separately installed DuckDB CLI.

## Test Report
A complete testing phase was successfully run with our core Vending Machine logic on DuckDB `1.0.0`. Read the full [TEST_REPORT.md](./TEST_REPORT.md) for details.
The historical Vending Machine report used DuckDB `1.0.0`. The retained Maven
gate verifies current JDBC compatibility; read [TEST_REPORT.md](./TEST_REPORT.md)
for the earlier test scope.
43 changes: 43 additions & 0 deletions teaql-duckdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
</parent>
<artifactId>teaql-duckdb</artifactId>
<name>teaql-duckdb</name>
<properties>
<!-- Override with -Dduckdb.version=... for compatibility gates. -->
<duckdb.version>1.5.5.1</duckdb.version>
</properties>
<dependencies>
<dependency>
<groupId>io.teaql</groupId>
Expand All @@ -19,5 +23,44 @@
<groupId>io.teaql</groupId>
<artifactId>teaql-utils</artifactId>
</dependency>
<dependency>
<groupId>org.duckdb</groupId>
<artifactId>duckdb_jdbc</artifactId>
<version>${duckdb.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.teaql</groupId>
<artifactId>teaql-provider-jdbc</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.teaql</groupId>
<artifactId>teaql-runtime</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--add-reads io.teaql.duck=io.teaql.runtime
--add-reads io.teaql.duck=java.sql
--add-opens io.teaql.duck/io.teaql.duckdb=io.teaql.utils
--add-opens io.teaql.core/io.teaql.core=io.teaql.utils
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class DuckDataServiceExecutor extends SqlDataServiceExecutor {

public DuckDataServiceExecutor(String name, SqlExecutionAdapter executionAdapter) {
super(name, executionAdapter);
this.debugDatabaseKind = "duckdb";
}

@Override
Expand Down Expand Up @@ -50,7 +51,11 @@ public void executeInTransaction(Runnable action) {

@Override
public List<Map<String, Object>> getTableColumns(String tableName) {
String sql = "SELECT column_name, data_type FROM information_schema.columns WHERE table_name = ?";
String sql = "SELECT column_name, data_type, data_type AS type_name, "
+ "character_maximum_length AS column_size, "
+ "numeric_precision, numeric_scale AS decimal_digits, "
+ "CASE WHEN is_nullable = 'YES' THEN 1 ELSE 0 END AS nullable "
+ "FROM information_schema.columns WHERE table_name = ?";
return getExecutionAdapter().queryForList(sql, new Object[] {tableName});
}
};
Expand Down
Loading
Loading