Logo vun Conventions Sql

Conventions Sql

Communautéit
Integralist
conventions-sql

MANDATORY for any work on SQL files (*.sql). Load this before editing or creating any *.sql file. SQL migration conventions covering simple DDL, idempotency, batching ALTER statements, comments, and formatting.

Iwwersiicht

EditeurIntegralist
Repositoryagent-skills
Skill-Nummconventions-sql
Stären
26
Forks
1
Matgeliwwert Fichieren
Nëmmen Instruktiounen
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum Integralist op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Conventions Sql an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/Integralist/agent-skills/tree/main/.agents/skills/conventions-sql
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Integralist/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/.agents/skills/conventions-sql .claude/skills/conventions-sql
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Conventions Sql an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Conventions Sql automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Conventions Sql net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

[!NOTE] If invoked directly with no specific task, load these conventions and stop. They are ready to apply when asked to design, write, or edit SQL.

Write migrations as literal statements a DBA can read top to bottom and apply. Most rules below concern migrations; formatting applies to all SQL. Examples use MySQL 8.0. The principles apply to any engine; syntax notes may not.

Migration statements

Keep DDL simple. Write a short sequence of literal statements, each exactly what the database will run. DBAs may apply them by hand, feed them to online schema-change tools, or diff them in review; all need the real statement in the file.

sql
ALTER TABLE users
    ADD COLUMN `email_reversed` VARCHAR(255)
    AS (SUBSTRING(REVERSE(`email`), 1, 255)) VIRTUAL
    AFTER `email`;

ALTER TABLE users
    ADD INDEX idx_account_email_reversed (`account_id`, `email_reversed`);

Do not use control flow. Migrations contain DDL and comments only. Do not hide statements with PREPARE/EXECUTE, feeding SET @var, IF() or CASE, string concatenation, GROUP_CONCAT, information_schema gates, loops, or BEGIN blocks. Dynamic SQL cannot be diffed or dry-run; gh-ost and pt-online-schema-change take a single ALTER, not a PREPARE block. Put such logic in application code or a runbook.

Let the runner handle idempotency and verification. The runner records applied versions and runs each migration once, so write against the schema left by earlier migrations. Use inline IF EXISTS or IF NOT EXISTS only where the engine supports it and the guard matters. MySQL supports these for DROP TABLE, DROP INDEX, and CREATE TABLE, not ALTER TABLE … ADD COLUMN or DROP COLUMN; use the bare statement rather than an emulated guard. End the file after the last DDL statement. A failed statement aborts the migration and shows the error; do not add SELECTs that re-check information_schema.

Batch changes. Use one ALTER per table so the table is rebuilt once. Order separate statements by dependency: drop unreferenced tables first and add a column before an index that uses it.

sql
ALTER TABLE jobs
    DROP INDEX idx_queue_shard,
    DROP COLUMN shard_number;

Document risk. Start with a header stating what the migration does, its ticket, and any DBA-relevant risk when choosing how to apply it: table rewrite versus instant metadata change, locks, row-count sensitivity, or online-schema-change compatibility. Comment inline only when the DDL's intent isn't clear. If a comment would describe a simpler alternative, use that simpler statement instead.

sql
-- Migration: add email_reversed generated column and index
-- Ticket: ABC-1234
--
-- Turns suffix matching into a prefix scan on the reversed column. The column
-- is VIRTUAL, so this is an instant metadata change with no row storage; the
-- index build is the only expensive part.

Keep data work out. Migrations change schema. Run backfills, rewrites, and cleanups as batched application code or documented procedures that can be throttled, resumed, and monitored. A migration loop has none of that and holds the migration lock while it runs. If plain DDL is insufficient, split the change into ordered migrations or give the DBA steps for their chosen tooling. Talk to the DBA rather than writing procedural SQL.

Formatting

  • One statement per intent, each ending in ;.
  • Uppercase keywords and snake_case identifiers.
  • When a statement exceeds one line, put each clause on its own indented line.
  • Quote identifiers consistently as the surrounding schema does (for example, MySQL backticks).
  • Follow the repo's migration numbering, naming, and rollback scheme.
  • Name every index and constraint explicitly, using existing prefixes (commonly idx_ for secondary indexes and uq_ for unique indexes).

Heefeg gestallte Froen

Wat mécht de KI-Skill Conventions Sql?

MANDATORY for any work on SQL files (*.sql). Load this before editing or creating any *.sql file. SQL migration conventions covering simple DDL, idempotency, batching ALTER statements, comments, and formatting.

Firwat Conventions Sql op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Conventions Sql besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Conventions Sql an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Integralist/agent-skills/tree/main/.agents/skills/conventions-sql an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Conventions Sql benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Conventions Sql benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Conventions Sql domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Conventions Sql gratis?

De Skill gëtt vum Integralist op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇