Skip to content

Commit c7c4de5

Browse files
docs: snapshot version 1.11.2
1 parent 98dce03 commit c7c4de5

Some content is hidden

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

50 files changed

+21759
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# AI Tools Reference
2+
3+
This page lists the configuration locations, skills, and database skills that Storm installs for each AI coding tool. For the main guide, see [AI-Assisted Development](ai.md).
4+
5+
---
6+
7+
## Tool Configuration Locations
8+
9+
Each AI tool stores its configuration in a different location, but the content is the same: Storm's conventions, entity rules, query patterns, and verification guidelines.
10+
11+
| Tool | Rules | Skills | MCP |
12+
|------|-------|--------|-----|
13+
| Claude Code | CLAUDE.md | .claude/skills/ | .mcp.json |
14+
| Cursor | .cursor/rules/storm.md | .cursor/rules/ | .cursor/mcp.json |
15+
| GitHub Copilot | .github/copilot-instructions.md | .github/instructions/ | (tool-dependent) |
16+
| Windsurf | .windsurf/rules/storm.md | .windsurf/rules/ | (manual config) |
17+
| Codex | AGENTS.md | - | .codex/config.toml |
18+
19+
---
20+
21+
## Skills
22+
23+
Skills are per-topic guides that the AI loads on demand when working on a specific task. Each skill contains focused instructions, code examples, and common pitfalls for one area of Storm. Skills are fetched from orm.st during setup and can be updated automatically on each run without requiring a CLI update.
24+
25+
| Skill | Purpose |
26+
|-------|---------|
27+
| storm-setup | Configure dependencies (detects Spring Boot, Ktor, or standalone) |
28+
| storm-docs | Load full Storm documentation |
29+
| storm-entity-kotlin | Create Kotlin entities |
30+
| storm-entity-java | Create Java entities |
31+
| storm-repository-kotlin | Write Kotlin repositories (framework-aware: Spring Boot, Ktor, standalone) |
32+
| storm-repository-java | Write Java repositories |
33+
| storm-query-kotlin | Kotlin QueryBuilder queries |
34+
| storm-query-java | Java QueryBuilder queries |
35+
| storm-sql-kotlin | Kotlin SQL Templates |
36+
| storm-sql-java | Java SQL Templates |
37+
| storm-json-kotlin / storm-json-java | JSON columns and JSON aggregation |
38+
| storm-serialization-kotlin / storm-serialization-java | Entity serialization for REST APIs (framework-aware content negotiation) |
39+
| storm-migration | Write Flyway/Liquibase migration SQL |
40+
41+
---
42+
43+
## Database Skills
44+
45+
With the [MCP server](database-and-mcp.md) configured, three additional skills become available:
46+
47+
| Skill | Purpose |
48+
|-------|---------|
49+
| storm-schema | Inspect your live database schema |
50+
| storm-validate | Compare entities against the live schema |
51+
| storm-entity-from-schema | Generate, update, or refactor entities from database tables |

website/versioned_docs/version-1.11.2/ai.md

Lines changed: 325 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Java API Reference
3+
---
4+
5+
# Java API Reference
6+
7+
Storm's Java API is organized into a set of focused modules. Each module has a specific role, from the core ORM engine to Spring Boot auto-configuration. This page provides an overview of the module structure and links to detailed documentation for each concept.
8+
9+
## Module Overview
10+
11+
### storm-java21
12+
13+
The main Java API module. It provides the `ORMTemplate` entry point, repository interfaces, SQL Templates using Java's String Templates (preview feature), and the type-safe query DSL. This is the primary dependency for Java applications.
14+
15+
```xml
16+
<dependency>
17+
<groupId>st.orm</groupId>
18+
<artifactId>storm-java21</artifactId>
19+
<version>@@STORM_VERSION@@</version>
20+
</dependency>
21+
```
22+
23+
**String Templates (Preview Feature):** The Java API uses JDK String Templates for SQL construction. String Templates are a preview feature in Java 21+, which means you must compile with `--enable-preview` and run with `--enable-preview`. The preview status means the syntax may change in future JDK releases, and Storm's Java API surface will adapt accordingly. The Kotlin API does not depend on any preview features and is fully stable.
24+
25+
To enable preview features in Maven:
26+
27+
```xml
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-compiler-plugin</artifactId>
31+
<configuration>
32+
<compilerArgs>
33+
<arg>--enable-preview</arg>
34+
</compilerArgs>
35+
</configuration>
36+
</plugin>
37+
```
38+
39+
### storm-spring
40+
41+
Spring Framework integration for Java. Provides `RepositoryBeanFactoryPostProcessor` for repository auto-discovery and injection, plus transaction integration. Add this module when you use Spring Framework without Spring Boot.
42+
43+
```xml
44+
<dependency>
45+
<groupId>st.orm</groupId>
46+
<artifactId>storm-spring</artifactId>
47+
<version>@@STORM_VERSION@@</version>
48+
</dependency>
49+
```
50+
51+
See [Spring Integration](spring-integration.md) for configuration details.
52+
53+
### storm-spring-boot-starter
54+
55+
Spring Boot auto-configuration for Java. Automatically creates an `ORMTemplate` bean from the `DataSource`, discovers repositories, and binds `storm.*` properties from `application.yml`. This is the recommended dependency for Spring Boot applications.
56+
57+
```xml
58+
<dependency>
59+
<groupId>st.orm</groupId>
60+
<artifactId>storm-spring-boot-starter</artifactId>
61+
<version>@@STORM_VERSION@@</version>
62+
</dependency>
63+
```
64+
65+
See [Spring Integration: Spring Boot Starter](spring-integration.md#spring-boot-starter) for what the starter provides and how to override its defaults.
66+
67+
## Key Classes
68+
69+
| Class | Description | Guide |
70+
|-------|-------------|-------|
71+
| `ORMTemplate` | The central entry point. Create with `ORMTemplate.of(dataSource)`. Provides access to entity/projection repositories and the SQL template query engine. | [Getting Started](getting-started.md) |
72+
| `EntityRepository<E, ID>` | Type-safe repository interface for CRUD operations on entities. Extend this interface and add custom query methods with default method bodies. | [Repositories](repositories.md) |
73+
| `ProjectionRepository<P, ID>` | Read-only repository for projections (subset of entity columns). | [Projections](projections.md) |
74+
| `Entity<ID>` | Marker interface for entity records. Implement this on your Java records to enable repository operations. | [Entities](entities.md) |
75+
| `Projection<ID>` | Marker interface for projection records. | [Projections](projections.md) |
76+
| `StormConfig` | Immutable configuration holder. Pass to `ORMTemplate.of()` to override defaults. | [Configuration](configuration.md) |
77+
78+
## Metamodel Generation
79+
80+
The `storm-metamodel-processor` annotation processor generates type-safe metamodel classes (e.g., `User_`) at compile time. These classes provide static references to entity fields for use in the query DSL, enabling compile-time checked queries.
81+
82+
```xml
83+
<dependency>
84+
<groupId>st.orm</groupId>
85+
<artifactId>storm-metamodel-processor</artifactId>
86+
<version>@@STORM_VERSION@@</version>
87+
<scope>provided</scope>
88+
</dependency>
89+
```
90+
91+
See [Metamodel](metamodel.md) for setup and usage.
92+
93+
## Javadoc
94+
95+
The aggregated Javadoc covers all Java modules in the Storm framework:
96+
97+
[Browse the Javadoc](../api/java/index.html)
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Kotlin API Reference
3+
---
4+
5+
# Kotlin API Reference
6+
7+
Storm's Kotlin API is organized into a set of focused modules. Each module has a specific role, from the core ORM engine with coroutine support to Spring Boot auto-configuration and validation. This page provides an overview of the module structure and links to detailed documentation for each concept.
8+
9+
## Module Overview
10+
11+
### storm-kotlin
12+
13+
The main Kotlin API module. It provides the `ORMTemplate` interface, extension functions (`DataSource.orm`, `Connection.orm`), repository interfaces, coroutine support, and the type-safe query DSL. This is the primary dependency for Kotlin applications.
14+
15+
```kotlin
16+
// Gradle (Kotlin DSL)
17+
implementation("st.orm:storm-kotlin:@@STORM_VERSION@@")
18+
```
19+
20+
```xml
21+
<!-- Maven -->
22+
<dependency>
23+
<groupId>st.orm</groupId>
24+
<artifactId>storm-kotlin</artifactId>
25+
<version>@@STORM_VERSION@@</version>
26+
</dependency>
27+
```
28+
29+
The Kotlin API does not depend on any preview features. All APIs are stable and production-ready.
30+
31+
### storm-kotlin-spring
32+
33+
Spring Framework integration for Kotlin. Provides `RepositoryBeanFactoryPostProcessor` for repository auto-discovery and injection, `@EnableTransactionIntegration` for bridging Storm's programmatic transactions with Spring's `@Transactional`, and transaction-aware coroutine support. Add this module when you use Spring Framework without Spring Boot.
34+
35+
```kotlin
36+
implementation("st.orm:storm-kotlin-spring:@@STORM_VERSION@@")
37+
```
38+
39+
See [Spring Integration](spring-integration.md) for configuration details.
40+
41+
### storm-kotlin-spring-boot-starter
42+
43+
Spring Boot auto-configuration for Kotlin. Automatically creates an `ORMTemplate` bean from the `DataSource`, discovers repositories, enables transaction integration, and binds `storm.*` properties from `application.yml`. This is the recommended dependency for Spring Boot applications.
44+
45+
```kotlin
46+
implementation("st.orm:storm-kotlin-spring-boot-starter:@@STORM_VERSION@@")
47+
```
48+
49+
See [Spring Integration: Spring Boot Starter](spring-integration.md#spring-boot-starter) for what the starter provides and how to override its defaults.
50+
51+
## Key Classes and Functions
52+
53+
| Class/Function | Description | Guide |
54+
|----------------|-------------|-------|
55+
| `ORMTemplate` | The central entry point. Create with `dataSource.orm` or `ORMTemplate.of(dataSource)`. Provides access to entity/projection repositories and the SQL template query engine. | [Getting Started](getting-started.md) |
56+
| `EntityRepository<E, ID>` | Type-safe repository interface for CRUD operations on entities. Extend this interface and add custom query methods with default method bodies. | [Repositories](repositories.md) |
57+
| `ProjectionRepository<P, ID>` | Read-only repository for projections (subset of entity columns). | [Projections](projections.md) |
58+
| `Entity<ID>` | Marker interface for entity data classes. Implement this on your Kotlin data classes to enable repository operations. | [Entities](entities.md) |
59+
| `Projection<ID>` | Marker interface for projection data classes. | [Projections](projections.md) |
60+
| `DataSource.orm` | Extension property that creates an `ORMTemplate` from a `DataSource`. | [Getting Started](getting-started.md) |
61+
| `transaction { }` | Coroutine-aware programmatic transaction block. | [Transactions](transactions.md) |
62+
| `transactionBlocking { }` | Blocking variant of the programmatic transaction block. | [Transactions](transactions.md) |
63+
| `StormConfig` | Immutable configuration holder. Pass to `dataSource.orm(config)` to override defaults. | [Configuration](configuration.md) |
64+
65+
## Coroutine Support
66+
67+
Storm's Kotlin API provides first-class coroutine support. Query results can be consumed as `Flow<T>` for streaming, and the `transaction { }` block is a suspending function that integrates with structured concurrency. Storm leverages JVM virtual threads under the hood, so database operations do not block platform threads even when using JDBC (which is inherently synchronous).
68+
69+
```kotlin
70+
// Streaming with Flow
71+
val users: Flow<User> = orm.entity(User::class).selectAll()
72+
users.collect { processUser(it) }
73+
74+
// Suspending transaction
75+
transaction {
76+
orm insert User(name = "Alice")
77+
}
78+
```
79+
80+
## Metamodel Generation
81+
82+
The metamodel generates type-safe companion classes (e.g., `User_`) at compile time. These classes provide static references to entity fields for use in the query DSL, enabling compile-time checked queries.
83+
84+
There are two ways to configure metamodel generation for Kotlin projects, depending on your build tool:
85+
86+
- **Gradle with KSP:** Use `storm-metamodel-ksp`, which is a Kotlin Symbol Processing plugin.
87+
- **Maven with kapt:** Use `storm-metamodel-processor`, which is a standard Java annotation processor invoked through kapt.
88+
89+
Both generate the same metamodel classes; they are different build tool integrations.
90+
91+
**Gradle (Kotlin DSL) with KSP:**
92+
93+
```kotlin
94+
plugins {
95+
id("com.google.devtools.ksp") version "2.0.21-1.0.28"
96+
}
97+
98+
dependencies {
99+
ksp("st.orm:storm-metamodel-ksp:@@STORM_VERSION@@")
100+
}
101+
```
102+
103+
**Maven with kapt:**
104+
105+
```xml
106+
<plugin>
107+
<groupId>org.jetbrains.kotlin</groupId>
108+
<artifactId>kotlin-maven-plugin</artifactId>
109+
<executions>
110+
<execution>
111+
<id>kapt</id>
112+
<goals><goal>kapt</goal></goals>
113+
<configuration>
114+
<annotationProcessorPaths>
115+
<path>
116+
<groupId>st.orm</groupId>
117+
<artifactId>storm-metamodel-processor</artifactId>
118+
<version>@@STORM_VERSION@@</version>
119+
</path>
120+
</annotationProcessorPaths>
121+
</configuration>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
```
126+
127+
See [Metamodel](metamodel.md) for setup and usage.
128+
129+
## KDoc
130+
131+
KDoc is generated per module using Dokka. Select a module below to browse its API documentation.
132+
133+
| Module | Description |
134+
|--------|-------------|
135+
| [storm-kotlin](../api/kotlin/storm-kotlin/index.html) | Kotlin API with coroutine support |
136+
| [storm-kotlin-spring](../api/kotlin/storm-kotlin-spring/index.html) | Spring Framework integration for Kotlin |
137+
| [storm-kotlin-spring-boot-starter](../api/kotlin/storm-kotlin-spring-boot-starter/index.html) | Spring Boot auto-configuration for Kotlin |
138+
| [storm-metamodel-ksp](../api/kotlin/storm-metamodel-ksp/index.html) | Kotlin Symbol Processing for metamodel generation |
139+
| [storm-kotlinx-serialization](../api/kotlin/storm-kotlinx-serialization/index.html) | Kotlinx Serialization support |

0 commit comments

Comments
 (0)