一键导入
sql-generation
SQL generation reference for SimpleORM — how TSimpleSQL builds queries, pagination by dialect, soft delete behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
SQL generation reference for SimpleORM — how TSimpleSQL builds queries, pagination by dialect, soft delete behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sql-generation |
| description | SQL generation reference for SimpleORM — how TSimpleSQL builds queries, pagination by dialect, soft delete behavior. |
| user-invocable | false |
Rules are in
.claude/rules/sql-safety.md— this skill provides generation flow reference and examples.
Entity (RTTI attributes)
→ TSimpleRTTI<T> extracts: TableName, Fields, PK, Where, SoftDeleteField, FieldsInsert, Param
→ TSimpleSQL<T> generates: SELECT, INSERT, UPDATE, DELETE
→ TSimpleDAO<T> fills Params via DictionaryFields
→ iSimpleQuery executes
| Method | Generates |
|---|---|
Select(var aSQL) | SELECT fields FROM table WHERE ... |
SelectId(var aSQL) | SELECT fields FROM table WHERE pk = :pk |
Insert(var aSQL) | INSERT INTO table (fields) VALUES (:params) |
Update(var aSQL) | UPDATE table SET field=:field WHERE pk=:pk |
Delete(var aSQL) | DELETE FROM or UPDATE SET soft=1 |
LastID(var aSQL) | SELECT FIRST(1) pk FROM table ORDER BY pk DESC |
LastRecord(var aSQL) | SELECT FIRST(1) fields FROM table ORDER BY pk DESC |
| Database | Syntax | Position |
|---|---|---|
| Firebird | SELECT FIRST n SKIP n fields FROM ... | After SELECT |
| MySQL | ... LIMIT n OFFSET n | End of query |
| SQLite | ... LIMIT n OFFSET n | End of query |
| Oracle | ... OFFSET n ROWS FETCH NEXT n ROWS ONLY | End of query |
WHERE soft_field = 0UPDATE table SET soft_field = 1 WHERE pk = :pkDELETE FROMLDAO.SQL
.Fields('ID, NAME')
.Where('STATUS = 1')
.OrderBy('NAME')
.GroupBy('CATEGORY')
.Join('INNER JOIN OTHER ON ...')
.Skip(10)
.Take(20)
.&End
.Find(LList);
LastID/LastRecord hardcoded to Firebird syntax (SELECT FIRST(1)) — not dialect-awareValidates all SimpleORM Delphi source files for Delphi 10.2 Tokyo+ compatibility. Checks inline vars, unit scoping, generics E2506, uses completeness, memory safety, .dpr structure, and conditional compilation. Run anytime to "lint" the project.
Delphi project file structure reference — .dpr vs .pas, .dproj, .res, .dfm. Templates for console and VCL projects.
CHANGELOG.md format reference and examples for the SimpleORM project.
Coding conventions and patterns for the SimpleORM Delphi project. Automatically loaded when writing or modifying Delphi code.
SimpleORM entity-to-database mapping via RTTI attributes. Complete reference for all attributes, property types, and relationship setup.
Horse/ExpxHorse integration patterns for SimpleORM — server auto-routing, client REST driver, serialization examples.