Skip to content

Commit fd2df6e

Browse files
CaliLukeclaude
andcommitted
TypeDB 3.8.0 support: iid(), label() built-ins, Unicode identifiers
## Changes ### TypeQL 3.8.0 Built-in Functions - Add `iid()` and `label()` built-in function expressions for fetching entity IIDs and type labels directly in queries - Add math functions: `abs_()`, `ceil()`, `floor()`, `round_()` - Add collection functions: `len_()`, `max_()`, `min_()` - New `type_bridge/expressions/builtin.py` module with unit and integration tests ### Query Improvements - Use `iid($e)` and `label($t)` in fetch clauses instead of dual-query patterns - Use `$e isa! $t; $t sub {type}` pattern to bind exact type for label() - Fix `_Value` concept extraction using `.get()` instead of `.as_value()` - Handle new dict format from TypeDB driver in aggregation/group_by results ### Unicode Identifier Validation - Add Unicode XID_START/XID_CONTINUE validation for identifiers - Update TypeQL grammar to support Unicode identifiers ### Bug Fixes - Fix "Failed to initialize logging" warning by suppressing stderr fd 2 during driver creation - Fix hardcoded port 1729 in test files (now uses configurable TEST_DB_ADDRESS) - Fix pyright errors for `__dict__` item assignment ### CI/Infrastructure - Update TypeDB version to 3.8.0-rc0 in docker-compose.yml and CI workflow - Add `expressions` test group to CI matrix Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9162f4b commit fd2df6e

27 files changed

Lines changed: 1573 additions & 425 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ jobs:
105105
runs-on: ubuntu-latest
106106
strategy:
107107
matrix:
108-
test-group: [crud, queries, schema]
108+
test-group: [crud, queries, schema, expressions]
109109

110110
# Start TypeDB as a service container (runs first, before steps)
111111
services:
112112
typedb:
113-
image: typedb/typedb:3.7.0-rc0
113+
image: typedb/typedb:3.8.0-rc0
114114
ports:
115115
- 1729:1729
116116

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ packages/typescript/dist/
2121

2222
# Temporary
2323
tmp/
24+
25+
# Reference repos
26+
typeql-ref/

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ generate_models("schema.tql", "./myapp/models/")
234234

235235
This generates a complete Python package:
236236

237-
```
237+
```text
238238
myapp/models/
239239
├── __init__.py # Package exports, SCHEMA_VERSION, schema_text()
240240
├── attributes.py # Attribute class definitions
@@ -245,6 +245,7 @@ myapp/models/
245245
```
246246

247247
The generator supports:
248+
248249
- Entity/relation/attribute inheritance (`sub` keyword)
249250
- `@key`, `@unique`, `@card` constraints (including on `plays` and `relates`)
250251
- `@regex` and `@values` constraints
@@ -265,6 +266,7 @@ See [docs/api/generator.md](docs/api/generator.md) for full documentation.
265266
- **[docs/TYPEDB.md](docs/TYPEDB.md)** - TypeDB concepts, driver API, and TypeQL syntax
266267
- **[docs/ABSTRACT_TYPES.md](docs/ABSTRACT_TYPES.md)** - Abstract types and interface hierarchies in TypeDB
267268
- **[docs/INTERNALS.md](docs/INTERNALS.md)** - Internal type system and architecture
269+
- **[docs/SKILL.md](docs/SKILL.md)** - AI assistant skill for using type-bridge (for Claude, GPT, etc.)
268270

269271
### API Reference
270272

@@ -375,10 +377,12 @@ uv run pytest -m "" -v # Run all tests
375377
## What's New in v1.2.2 (2025-12-25)
376378

377379
**Critical Bug Fixes:**
380+
378381
- 🐛 **Fixed RelationManager IID correlation** (Issue #78) - `RelationManager.all()` now correctly assigns unique IIDs to role players instead of duplicating the same IIDs across all relations
379382
- 🐛 **Fixed stack overflow in `__in` lookups** (Issue #76) - Large `__in` queries (75+ values) now work reliably without causing TypeDB query planner crashes
380383

381384
**Previous Releases:**
385+
382386
- v1.2.0 - TypeDB 3.0 Structs Support & Batch Query Optimizations
383387
- v1.1.0 - Polymorphic Entity Instantiation
384388
- v1.0.0 - Initial stable release

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
typedb:
3-
image: typedb/typedb:3.7.0
3+
image: typedb/typedb:3.8.0-rc0
44
container_name: typedb_test
55
ports:
66
- "${TYPEDB_PORT:-1730}:1729"

0 commit comments

Comments
 (0)