Skip to content

Commit 64b3c7b

Browse files
author
Philip Z
committed
fix(schema): reconcile constant seeds and ID floor (#79)
1 parent 01a40e9 commit 64b3c7b

80 files changed

Lines changed: 6267 additions & 37 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎examples/conformance/lib/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>io.teaql</groupId>
5454
<artifactId>teaql-sqlite</artifactId>
55-
<version>1.537-RELEASE</version>
55+
<version>1.538-RELEASE</version>
5656
</dependency>
5757
<dependency>
5858
<groupId>io.teaql</groupId>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
*.gz
3+
target/
4+
5+
### IntelliJ IDEA ###
6+
.idea/*
7+
.idea/modules.xml
8+
.idea/jarRepositories.xml
9+
.idea/compiler.xml
10+
.idea/libraries/
11+
*.iws
12+
*.iml
13+
*.ipr
14+
out/
15+
!**/src/main/**/out/
16+
!**/src/test/**/out/
17+
18+
### Eclipse ###
19+
.apt_generated
20+
.classpath
21+
.factorypath
22+
.project
23+
.settings
24+
.springBeans
25+
.sts4-cache
26+
bin/
27+
!**/src/main/**/bin/
28+
!**/src/test/**/bin/
29+
30+
### NetBeans ###
31+
/nbproject/private/
32+
/dist/
33+
/nbdist/
34+
35+
### VS Code ###
36+
.vscode/
37+
38+
### Mac OS ###
39+
.DS_Store
40+
41+
*.class
42+
*.log
43+
*.contextt
44+
.mtj.tmp/
45+
*.jar
46+
*.war
47+
*.nar
48+
*.ear
49+
*.zip
50+
*.tar.gz
51+
*.rar
52+
hs_err_pid*
53+
replay_pid*
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!-- DISCARD_BLOCK: phase_modeling -->
2+
3+
# TeaQL Java Agent Instructions
4+
5+
> [!WARNING]
6+
> **IGNORE GENERIC ORM EXPERIENCE**
7+
>
8+
> Do **not** use pre-trained habits from data-access frameworks, ORMs, or database integration libraries.
9+
>
10+
> Do **not** use MyBatis, JPA, Hibernate, Spring Data, MyBatis-Plus, or similar frameworks.
11+
>
12+
> Do **not** write raw SQL, DAOs, Repository implementations, or custom persistence layers.
13+
>
14+
> Do **not** guess TeaQL method names.
15+
16+
## How to Write Domain Code
17+
18+
To get the exact API usage and query examples for the entity you are working on, execute the following command:
19+
20+
```bash
21+
cargo teaql --input models/school-management-service.xml java-assist-[action]/[entity-name]
22+
```
23+
24+
> `models/school-management-service.xml` is the default model path. If the model file is located elsewhere, adjust the `--input` path to match the actual file location in this project.
25+
26+
Replace `[action]` with one of the following:
27+
28+
| action | when-to-use |
29+
|--------|-------------|
30+
| query | Read/find records from the database using Q. |
31+
| create | Insert a new record into the database |
32+
| update | Modify and save an existing record |
33+
| delete | Remove or soft-delete a record |
34+
| expression | Safely extract nested relation values using E. |
35+
| list-page | Implement a paginated query returning SmartList |
36+
| debug | View instructions for enabling SQL logging and debugging |
37+
38+
Replace `[entity-name]` with the exact entity-name from the table below:
39+
40+
| entity-name | display-name |
41+
|-------------|--------------|
42+
| platform | Platform |
43+
| school_type | School Type |
44+
| school | School |
45+
46+
47+
Once the command succeeds, read its output. Use the printed code as a template to write your logic.
48+
49+
If the command cannot be executed, stop and report the missing context. Do not invent APIs.
50+
51+
## Additional References
52+
53+
Read these only when the task requires them:
54+
55+
* **`TOOL_API_GUIDE.md`**
56+
Framework runtime references and context handling.
57+
58+
* **`RUNTIME_CUSTOM_GUIDE.md`**
59+
Runtime setup, debugging, and project-specific restrictions.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
**ATTENTION AI AGENTS:** Do not guess TeaQL API methods! To get the exact API usage and query examples for the entity you are working on, you must fetch the dynamically generated prompt directly from the code generation server. Use your tools to execute the following command to download the exact contextual prompt for the entity:
3+
4+
```bash
5+
cargo teaql --input models/school-management-service.xml java-assist-[action]/[entity-name]
6+
```
7+
8+
Replace `[entity-name]` with the exact entity-name of the entity.
9+
10+
**Available candidate entities in this model:**
11+
12+
| entity-name | display-name |
13+
|-------------|--------------|
14+
| platform | Platform |
15+
| school_type | School Type |
16+
| school | School |
17+
18+
19+
Replace `[action]` with one of the following depending on what you are trying to write:
20+
21+
| action | when-to-use |
22+
|--------|-------------|
23+
| query | You need to read/find records from the database using Q:: |
24+
| create | You need to insert a new record into the database |
25+
| update | You need to modify and save an existing record |
26+
| delete | You need to remove or soft-delete a record |
27+
| expression | You need to safely extract nested relation values (avoiding null panics) using the E:: facade |
28+
| list-page | You need to implement a paginated query returning a SmartList |
29+
30+
Once the command succeeds, read its output. Use the printed code as a template to write your logic.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
# TEAQL WARNING: This project uses TeaQL. TeaQL was explicitly designed to PREVENT AI hallucinations and random guessing.
3+
# AI AGENTS MUST STRICTLY USE THESE MAKE TARGETS ONLY. Do NOT guess other build commands.
4+
5+
.PHONY: build test run clean help generate-lib
6+
7+
# Default target
8+
help:
9+
@echo "Available commands:"
10+
@echo " make generate-lib - Regenerate the TeaQL domain library"
11+
@echo " make build - Build the Spring Boot application (mvn clean package)"
12+
@echo " make test - Run application tests (mvn test)"
13+
@echo " make run - Run the application locally (mvn spring-boot:run)"
14+
@echo " make clean - Clean the project"
15+
16+
generate-lib:
17+
@echo "Regenerating TeaQL library..."
18+
./gen-lib.sh || echo "Please ensure gen-lib.sh exists or run teaql code generator manually"
19+
20+
build:
21+
mvn clean package -DskipTests
22+
23+
test:
24+
mvn test
25+
26+
run:
27+
mvn spring-boot:run
28+
29+
clean:
30+
mvn clean
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# School Management bootstrap example
2+
3+
This generated example retains `models/school-model.xml`. It explicitly calls
4+
SQLite `ensureSchema` twice and verifies Platform `id=1` plus SchoolType constants
5+
`1001`/`1002` are present exactly once with version 1.
6+
7+
Before publication, install the repository's local runtime and then run the
8+
generated workspace. The portable SQL runtime test separately changes a constant
9+
and verifies optimistic, single-version reconciliation.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# TeaQL Runtime Customization Guide
3+
4+
> [!WARNING]
5+
> **DO NOT GUESS RUNTIME CONFIGURATION**
6+
> Do not guess how to configure the runtime, connection pools, or schema generation.
7+
8+
To get the exact usage and examples for Customizing the Runtime (UserContext assembly, SQL debugging, Schema modes), you must fetch the dynamically generated prompt directly from the code generation server. Use your tools to execute the following command:
9+
10+
```bash
11+
cargo teaql --input models/school-management-service.xml java-assist-runtime-custom
12+
```
13+
14+
Once the command succeeds, read its output. Use the printed code as a template to write your logic.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
# TeaQL Tool & Runtime API Reference
3+
4+
> [!WARNING]
5+
> **DO NOT GUESS FRAMEWORK APIS**
6+
> Do not guess how to use `UserContext`, `SmartList`, `WebResponse`, or how to manage transactions.
7+
8+
> [!IMPORTANT]
9+
> **USE TEAQL'S OWN TOOLING FIRST**
10+
> Always use `cargo teaql` to retrieve assist content. Never bypass the CLI or invoke the generator endpoint directly.
11+
12+
To get the exact API usage and examples for Framework-level APIs (UserContext, SmartList, WebResponse, Entity Expression, Checkers, etc.), you must fetch the dynamically generated prompt directly from the code generation server. Use your tools to execute the following command:
13+
14+
```bash
15+
cargo teaql --input models/school-management-service.xml java-assist-tool-api
16+
```
17+
18+
Once the command succeeds, read its output. Use the printed code as a template to write your logic.
19+
20+
## Domain Object Assist APIs
21+
22+
If you need reference code or tool APIs specifically tailored for your domain objects (e.g., `user`, `order`), TeaQL provides code generators that yield perfect, ready-to-copy Java code snippets.
23+
24+
You can query these assist APIs for any object defined in your `models/school-management-service.xml`:
25+
26+
| Target | Description | Example Command |
27+
|--------|-------------|-----------------|
28+
| `java-assist-query/[object]` | How to query and filter `[object]` | `cargo teaql --input models/school-management-service.xml java-assist-query/school` |
29+
| `java-assist-create/[object]` | How to insert/create `[object]` | `cargo teaql --input models/school-management-service.xml java-assist-create/school` |
30+
| `java-assist-update/[object]` | How to update `[object]` | `cargo teaql --input models/school-management-service.xml java-assist-update/school` |
31+
| `java-assist-delete/[object]` | How to delete `[object]` | `cargo teaql --input models/school-management-service.xml java-assist-delete/school` |

0 commit comments

Comments
 (0)