Agent skill

Anyline

by anylineorg in anylineorg/anyline

AnyLine数据库操作开发规范,涵盖动态数据源注册切换注销、DDL动态建表改表、DML增删改与事务管理、DQL动态查询与聚合统计、元数据管理、查询结果集的聚合、过滤、格式转换等数学计算,AnyLine方法内部会自动适配100+数据库方言,调用方法时忽略不同数据库差异。

Apache-2.0Auto-check passedDatabases

Install Anyline

skills CLI
$ npx skills add anylineorg/anyline --skill anyline -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install anylineorg/anyline anyline --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/anylineorg/anyline.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.ai/skills/anyline .claude/skills/anyline && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
anyline
GitHub stars
346
Token cost
~1.3k tokens
SKILL.md length
154 words
Files
14 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

AnyLine数据库操作开发规范,涵盖动态数据源注册切换注销、DDL动态建表改表、DML增删改与事务管理、DQL动态查询与聚合统计、元数据管理、查询结果集的聚合、过滤、格式转换等数学计算,AnyLine方法内部会自动适配100+数据库方言,调用方法时忽略不同数据库差异。

  • Works in 4 steps: 通过 ServiceProxy 切换 → 通过表名前缀临时切换 → 临时数据源 → …
  • Tasks that involve SQL
  • SKILL.md covers 核心模块索引, 扩展数据源类型, 数据源切换方式 and 返回SQL方言(DDL/DML/DQL)以及SQL日志, plus 2 more sections
  • Needs DEFAULT_PRIMARY_KEY and IS_UPPER_KEY

What it does

Anyline is an agent skill from anylineorg/anyline. AnyLine数据库操作开发规范,涵盖动态数据源注册切换注销、DDL动态建表改表、DML增删改与事务管理、DQL动态查询与聚合统计、元数据管理、查询结果集的聚合、过滤、格式转换等数学计算,AnyLine方法内部会自动适配100+数据库方言,调用方法时忽略不同数据库差异。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including reference files (for example `references/authorize.md`, `references/condition.md` and `references/datarow.md`).

It sits in Databases, covering SQL. It works with SQL and Neo4j. The repository describes itself as: 运行时动态注册切换数据源,自动生成SQL(DDL/DML/DQL),读写元数据,对比数据库结构差异。适配100+关系/非关系数据库。 常用于动态场景的底层支持,如:数据中台、可视化、低代码后台、工作流、自定义表单、异构数据库迁移同步、数据血缘、运行时自定义报表/查询条件/数据结构等. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve SQL

Example prompts

  • “/anyline”

Requirements

  • A credential in DEFAULT_PRIMARY_KEY
  • A credential in IS_UPPER_KEY

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. 通过 ServiceProxy 切换
  2. 通过表名前缀临时切换
  3. 临时数据源
  4. 虚拟数据源(仅生成SQL不执行)

What it can do on your machine

Read from SKILL.md and the folder at commit e20f9f2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • DEFAULT_PRIMARY_KEY
    • IS_UPPER_KEY
    • IS_LOWER_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Anyline loads about 1.3k tokens when it runs, and up to ~65k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 154 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~65k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from anylineorg/anyline at commit e20f9f2, republished under its Apache-2.0 licence (© anylineorg). 154 words, ~1,316 tokens.

Download SKILL.mdSave it as .claude/skills/anyline/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
anyline
description
AnyLine数据库操作开发规范,涵盖动态数据源注册切换注销、DDL动态建表改表、DML增删改与事务管理、DQL动态查询与聚合统计、元数据管理、查询结果集的聚合、过滤、格式转换等数学计算,AnyLine方法内部会自动适配100+数据库方言,调用方法时忽略不同数据库差异。

AnyLine 开发助手

AnyLine 是一个元数据驱动的动态数据管理框架,核心能力是通过统一 API 完成所有数据库操作,由框架内部自动适配 100+ 种数据库并屏蔽数据库间的语法差异,运行时自动生成适配目标数据库的原生 SQL。 你作为一个精通 AnyLine 的专家在生成 AnyLine 相关代码时,需要注意:

  • 你需要根据下方模块索引,在 references/ 文件夹中找到对应的详细 API 文档。
  • 所有数据库操作,无论是 DDL、DML 还是 DQL,都通过 AnylineService 提供的方法完成。
  • 如果当前类中注入的AnylineService实例则用注入的实例调用,否则用ServiceProxy调用,如service.select("hr_user")或ServiceProxy.select("hr_user")
  • 如果遇到 AnyLine 没有实现或者你不确定的功能,需要及时向用户说明,不要自己编造。

核心模块索引

数据源与连接
  • 动态数据源:动态数据源注册、切换、注销、验证、临时数据源、虚拟数据源
数据操作
  • DDL:表、列、视图、索引、约束、主外键、存储过程、函数、触发器等数据库对象创建、修改、删除
  • DML:插入、更新、删除、upsert、批量执行相关操作
  • DQL:查询、条件构建、分页、排序、分组、子查询、流式查询
  • condition:自动封装HTTP参数合成查询条件
数据容器
  • DataRow:DataRow数据行操作、类型转换、JSON解析
  • DataSet:DataSet结果集聚合、分组、过滤、排序、格式化等计算
元数据管理
  • 元数据:表、列、视图、索引、约束、主外键、存储过程、函数、触发器等数据库对象信息查询
  • 权限:用户、角色、权限的查询、创建、删除、授权
事务与扩展
  • 事务管理:编程式事务、传播级别、隔离级别、保存点、跨线程事务
  • 拦截器:SQL执行拦截、参数修改、结果处理
  • 监听器:DDL/DML事件监听、数据源加载监听
  • 图数据库:Neo4j、Nebula Graph、TuGraph 图数据库操作

扩展数据源类型

AnyLine 支持多种非关系型数据库和特殊数据源,通过统一的 API 进行操作:

图数据库
  • Neo4j:通过 anyline-data-neo4j 或 anyline-data-jdbc-neo4j 模块支持
  • Nebula Graph:通过 anyline-data-nebula 模块支持
  • TuGraph:通过 anyline-data-tugraph 模块支持
  • 操作方式与关系型数据库类似,使用 service.selects() 等方法,框架自动生成 Cypher 或 nGQL
文档数据库
  • MongoDB:通过 anyline-data-mongodb 模块支持
  • 支持 Document 结构的 CRUD 操作
AI 数据源
  • Dify:通过 anyline-data-dify 模块支持,用于 RAG 文档检索
  • Coze:通过 anyline-data-coze 模块支持
其他数据源
  • ElasticSearch:通过 anyline-data-jdbc-elasticsearch 模块支持
  • Cassandra:通过 anyline-data-jdbc-cassandra 模块支持
  • HBase:通过 anyline-data-hbase 模块支持

数据源切换方式

1. 通过 ServiceProxy 切换
java
// 获取指定数据源的 Service
AnylineService crmService = ServiceProxy.service("crm");
crmService.select("CRM_USER");

// 获取默认数据源的 Service
AnylineService defService = ServiceProxy.service();
defService.select("HR_USER");
2. 通过表名前缀临时切换
java
// 在表名前添加数据源名称,仅当前查询有效
service.select("<crm>CRM_USER");
3. 临时数据源
java
// 创建临时数据源,用完自动回收
DataSource ds = DataSourceUtil.build(...);
AnylineService service = ServiceProxy.temporary(ds);
service.select("CRM_USER");
4. 虚拟数据源(仅生成SQL不执行)
java
// 根据数据库类型创建虚拟数据源,用于生成SQL脚本
AnylineService service = ServiceProxy.service(DatabaseType.POSTGRESQL);
ConfigStore configs = new DefaultConfigStore();
service.selects("CRM_USER", configs);
List<Run> runs = configs.runs();
// 获取生成的 PostgreSQL SQL

返回SQL方言(DDL/DML/DQL)以及SQL日志

SQL执行过程中,在控制台或日志文件中会生成带占位符的日志。
如果需要在执行完成后返回SQL(DQL DDL DML),可以在service调用的方法中添加ConfigStore参数
在执行完成后从ConfigStore中获取执行的SQL,
因为执行的SQL可能是多条,所以会返回一个List<Run>集合,
默认情况下Run中的SQL是带占位符的,与占位值分开存储

java
List<Run> runs = configs.runs();
for (Run run:runs){
    System.out.println("无占位符 sql:"+run.getFinalQuery(false));
    System.out.println("有占位符 sql:"+run.getFinalQuery());
    System.out.println("占位values:"+run.getValues());
}

如果只需要生成SQL,但不执行,可以调用相应的adapter.buildQueryRun/buildDeleteRun等方法 返回的Run与以上操作相同

因为adapter平时不常用,所以许多人对此不太熟悉,也可以在ConfigStore上调用execute(false)方法
然后调用service.selects/insert/save/update()时提供这个ConfigStore这样querys/insert/save/update等执行后实际SQL并没有执行,只是把生成的SQL保存到了configs.runs

java
ConfigStore configs = new DefaultConfigStore().execute(false);//false表示最后实际操作数据库的一步不执行
DataSet set = service.selects(table, configs);
System.out.println(set);//因为最后一步没有执行,所以这里应该输出空集合
 
List<Run> runs = configs.runs();
for (Run run:runs){
     System.out.println("无占位符 sql:"+run.getFinalQuery(false));
     System.out.println("有占位符 sql:"+run.getFinalQuery());
     System.out.println("占位values:"+run.getValues());
}

DDL也类似,因为DDL执行过程中有元数据的对象所以execute(false)在metadata(table/column等)上执行

java
Table table = service.metadata().table("sso_user"); //获取表结构
table.execute(false);//不执行SQL
service.ddl().create(table);
List<Run> runs = table.runs(); //返回创建表的DDL
for (Run run : runs){
    String sql = run.getFinalUpdate();
    System.out.println(sql);
}

常用配置项

通过 ConfigTable 可以设置全局配置:

java
// 主键默认列名
ConfigTable.DEFAULT_PRIMARY_KEY = "ID";

// 是否自动检测元数据
ConfigTable.IS_AUTO_CHECK_METADATA = true;

// 元数据缓存时间(秒)
ConfigTable.METADATA_CACHE_SECOND = 3600 * 24;

// 是否返回空实例替代null
ConfigTable.IS_RETURN_EMPTY_INSTANCE_REPLACE_NULL = true;

// 列名大小写处理
ConfigTable.IS_UPPER_KEY = true;  // 列名转大写
ConfigTable.IS_LOWER_KEY = false; // 列名转小写

// 空值处理
ConfigTable.IS_INSERT_NULL_COLUMN = false;
ConfigTable.IS_UPDATE_NULL_COLUMN = false;
ConfigTable.IS_INSERT_EMPTY_COLUMN = false;
ConfigTable.IS_UPDATE_EMPTY_COLUMN = false;

注意事项

  1. 数据源切换:8.7.2版本后取消了 ThreadLocal 方式的数据源切换,改用 ServiceProxy.service(key) 方式
  2. 主键处理:默认主键为 ID,可通过 ConfigTable.DEFAULT_PRIMARY_KEY 修改
  3. 空值处理:默认空值(null/空字符串)不参与插入和更新,可通过配置修改
  4. 事务支持:临时数据源不支持注解方式的事务,需使用编程式事务
  5. 批量操作:大批量插入建议使用 batch 参数,如 service.insert(200, table, set)

© anylineorg, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (references) in .ai/skills/anyline of anylineorg/anyline.

  • SKILL.md
  • references/authorize.md
  • references/condition.md
  • references/datarow.md
  • references/dataset.md
  • references/datasource.md
  • references/ddl.md
  • references/dml.md
  • references/dql.md
  • references/graph.md
  • references/interceptor.md
  • references/listener.md
  • references/metadata.md
  • references/transaction.md

Open the folder on GitHubat commit e20f9f2

Compare with similar skills

Anyline next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Anyline compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Anyline this skillanylineorg/anyline346—~1.3kAutomated safety check: PassApache-2.0
Wiki ExportAr9av/obsidian-wiki3.5k—~6.9kAutomated safety check: NotesMIT
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
StarRocks SQL Doc Auto-FixStarRocks/starrocks12k—~7.6kAutomated safety check: NotesApache-2.0
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • Wiki Export

    Ar9av/obsidian-wiki

    Export the Obsidian wiki graph to JSON, GraphML, Neo4j Cypher, Postgres/SQL, HTML, or OKF bundles.

    3.5k GitHub stars~6.9k tokensUpdated yesterday
    Knowledge ManagementAuto-check: notes
  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • StarRocks SQL Doc Auto-Fix

    StarRocks/starrocks

    Proposes verified fixes for failing SQL examples in StarRocks docs across three languages and several versions, then opens draft pull requests and never merges.

    12k GitHub stars~7.6k tokensUpdated today
    DatabasesAuto-check: notes
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Wtf

    noobnooc/agent

    Pre-launch and pre-commit audit for vibe coding projects. An agent skill from noobnooc/agent.

    1.4k GitHub stars~2.1k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes

Works with

Categories

Questions about Anyline

What does Anyline do?

AnyLine数据库操作开发规范,涵盖动态数据源注册切换注销、DDL动态建表改表、DML增删改与事务管理、DQL动态查询与聚合统计、元数据管理、查询结果集的聚合、过滤、格式转换等数学计算,AnyLine方法内部会自动适配100+数据库方言,调用方法时忽略不同数据库差异。. Anyline is an agent skill from anylineorg/anyline.

When should I use Anyline?

Anyline fits situations like: tasks that involve SQL.

How do I install Anyline in Claude Code?

Run `npx skills add anylineorg/anyline --skill anyline -a claude-code`. Or copy the skill folder (.ai/skills/anyline in anylineorg/anyline) into .claude/skills/anyline in your project. Claude Code loads it when a task matches its description.

How do I install Anyline in Codex?

Run `npx skills add anylineorg/anyline --skill anyline -a codex`. Or copy the skill folder (.ai/skills/anyline in anylineorg/anyline) into .agents/skills/anyline in your project. Codex loads it when a task matches its description.

Can I use Anyline in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add anylineorg/anyline --skill anyline -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/anyline, .gemini/skills/anyline, .github/skills/anyline and .opencode/skills/anyline in your project.

What does Anyline need to run?

Going by SKILL.md and its folder, Anyline needs credentials named DEFAULT_PRIMARY_KEY, IS_UPPER_KEY and IS_LOWER_KEY. Our summary lists: A credential in DEFAULT_PRIMARY_KEY; A credential in IS_UPPER_KEY.

Does Anyline access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Anyline safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Anyline use?

Anyline is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Anyline use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 63k tokens, read only when the agent opens those files.

What are the alternatives to Anyline?

Skills that share tags, products or a category with Anyline: Wiki Export (Ar9av/obsidian-wiki, 3.5k stars), Evolving The Data Model (TriliumNext/Trilium, 38k stars), SQL Database Support for pREST (prest/prest, 4.6k stars) and StarRocks SQL Doc Auto-Fix (StarRocks/starrocks, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Anyline?

anylineorg (a GitHub user) maintains it in anylineorg/anyline, which has 346 GitHub stars. The repository was last updated on October 5, 2026.

Source: anylineorg/anyline on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.