ivy-interactive/ivy-framework/ivy-create-db-connection
Claude Code and agent skill by ivy-interactive/ivy-framework
- community
Checking that the SKILL.md file is still in the repository.
Add a database connection to an Ivy project. Supports SQL Server, Postgres, Supabase, MySQL, MariaDB, SQLite, Airtable, Oracle, Spanner, ClickHouse, and Snowflake. Scaffolds a DbContext from an existing database with Entity Framework. Use when the user wants to connect to a database.
Install
npx vskill@latest install ivy-interactive/ivy-framework/ivy-create-db-connectionSKILL.md
ivy-create-db-connection
Add a database connection to an existing Ivy project. This skill guides you through selecting a database provider, collecting connection details, and generating a DbContext with Entity Framework scaffolding.
Pre-flight: Read Learnings
If the file .ivy/learnings/ivy-create-db-connection.md exists in the project directory, read it first and apply any lessons learned from previous runs of this skill.
Reference Files
Read before implementing:
- references/AGENTS.md -- Ivy framework API reference (widgets, hooks, layouts, inputs, colors)
Step 1: Validate the Project
- Verify this is a valid Ivy project. Check for a
.csprojfile andProgram.csin the working directory. If this is not an Ivy project, tell the user and stop.
- Clean up any empty connection folders under
Connections/if they exist.
Step 2: Choose a Database Provider
- If the user has not already specified a provider, ask them to choose one from the supported list:
| Provider | Display Name | Connection String Template | Supports Schemas | Default Schema | |
|---|---|---|---|---|---|
| SqlServer | SQL Server | Server=localhost;Database={name};Trusted_Connection=True;TrustServerCertificate=True; | Yes | dbo | |
| Postgres | Postgres | Host=localhost;Database={name};Username=postgres;Password=postgres; | Yes | public | |
| Supabase | Supabase | Host=db.<project-ref>.supabase.co;Database=postgres;Username=postgres;Password=<password>;Port=5432; | Yes | public | |
| MySql | MySQL | Server=localhost;Database={name};User=root;Password=root; | No | -- | |
| MariaDb | MariaDB | Server=localhost;Database={name};User=root;Password=root; | No | -- | |
| Sqlite | SQLite | Data Source={name}.db; | No | -- | |
| Airtable | Airtable | (custom) | No | -- | |
| Oracle | Oracle | Data Source=localhost:1521/XEPDB1;User Id=system;Password=oracle; | No | -- | |
| Spanner | Spanner | Data Source=projects/<project>/instances/<instance>/databases/<database>; | No | -- | |
| ClickHouse | ClickHouse | Host=localhost;Port=8123;Database={name}; | No | -- | |
| Snowflake | Snowflake | account=<account>;host=<account>.snowflakecomputing.com;user=<user>;password=<password>;db={name};schema=PUBLIC;warehouse=<warehouse>; | No | -- |
Step 3: Collect Connection Details
- Ask the user for a connection name in PascalCase (e.g. "MyDatabase", "SalesDb"). The name must match the regex
^[A-Z][a-zA-Z0-9]*$. If the name is invalid, ask the user to provide a valid one.
- Collect the connection string. The user may provide either:
- A complete connection string -- pass it through as-is
- Individual database credentials (host, port, user, password, database name) -- construct the full connection string using the provider's template
Connection string formats by provider:
- Postgres / Supabase:
Host={host};Port={port};Database={db};Username={user};Password={password} - SQL Server:
Server={host},{port};Database={db};User Id={user};Password={password};TrustServerCertificate=True - MySQL / MariaDB:
Server={host};Port={port};Database={db};User={user};Password={password}; - Oracle:
Data Source={host}:{port}/{service};User Id={user};Password={password};
If the connection string cannot be inferred from context, ask the user for it.
- For providers that support schemas (SQL Server, Postgres, Supabase), ask the user which database schema to use. Recommend the provider's default schema (e.g.
dbofor SQL Server,publicfor Postgres/Supabase).
Step 4: Generate the Connection
- Create the connection directory at
Connections/[ConnectionName]/.
- The connection generation involves:
- Adding the provider-specific EF Core NuGet packages
- Storing the connection string in dotnet user secrets as
ConnectionStrings:[ConnectionName] - Scaffolding the DbContext and entity classes from the database using
dotnet ef dbcontext scaffold - Creating the connection class implementing
IConnection
- Initialize user secrets and store the connection string:
- Consult the provider documentation (via
https://docs.ivy.app/sitemap.xmlor documentation markdown endpoints) if you need details about the EF Core provider package name, scaffolding options, or connection registration pattern.
Expected directory structure after completion:
Step 5: Verify
- Run
dotnet buildto verify everything compiles. Fix any errors.
- Run
dotnet buildto verify the project compiles. Then test the connection by runningdotnet runand verifying the app starts without errors. If the test fails, investigate and fix the issue. Common causes:
- Build errors: identify and fix compilation issues
- Network/auth errors: verify connection string, credentials, and server reachability
- SSL issues: check TrustServerCertificate or SSL mode settings
- If the project is in a git repository, create a commit with a descriptive message, for example: "Added [ProviderDisplayName] connection '[ConnectionName]'."
- Tell the user the connection is ready and summarize:
- Connection name and provider
- Files generated in
Connections/[ConnectionName]/ - Connection string stored in dotnet user secrets as
ConnectionStrings:[ConnectionName] - Schema used (if applicable)
- After confirming the connection works, review the user's original request. If they asked to generate apps from the database (e.g., "generate apps for each table", "create CRUD apps"), use the
/ivy-create-crudor/ivy-create-appskill for each entity. Useivy cli explain connections/[ConnectionName]to get the list of entities.
Recovery
If the setup fails:
- Diagnose the root cause (build errors, SSL settings, credentials, network issues):
- For build errors: use
dotnet buildto identify and fix compilation issues - For network/auth errors: verify connection string, credentials, and server reachability
- After fixing the underlying issue, either retry using the
/ivy-create-db-connectionskill from scratch, or manually create the connection:
- Create a DbContext class in
Connections/[ConnectionName]/ - Create entity classes matching the database tables
- Register the connection in Program.cs
- Test the connection with a simple query
- Consult the documentation endpoints for API guidance on creating a DbContext or registering database connections.
Post-run: Evaluate and Improve
After completing the task:
- Evaluate: Did the build succeed? Were there compilation errors, unexpected behavior, or manual corrections needed during this run?
- Update learnings: If anything required correction or was surprising, append a concise entry to
.ivy/learnings/ivy-create-db-connection.md(create the file and.ivy/learnings/directory if they don't exist). Each entry should note: the date, what went wrong, why, and what to do differently next time. - Skip if clean: If everything succeeded without issues, do not update the learnings file.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/claude-plugin/skills/ivy-create-db-connection/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ivy-interactive/ivy-framework/ivy-create-db-connection)