SQL Database Access

Build type-safe SQL queries with Kysely across JavaScript runtimes.

1|Updated Nov 3, 2024
One-click install
npx skills add https://github.com/kingstinct/.github --skill sql-database-access
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: SQL Database Access
Source: https://github.com/kingstinct/.github/tree/main/kysely-sql/skills/sql
Command: npx skills add https://github.com/kingstinct/.github --skill sql-database-access

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires kysely, kysely-expo, kysely-bun-sqlite, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust and type-safe way to interact with SQL databases, abstracting away the complexities of raw SQL queries and ensuring data integrity.

Core Features & Use Cases

  • Type-Safe Query Building: Use Kysely to write SQL queries with full TypeScript support, catching errors at compile time.
  • Platform Agnostic: Supports both Expo (React Native) with expo-sqlite and Bun backends with bun:sqlite.
  • Use Case: Securely store and retrieve user data, manage application state, or perform complex data manipulations in your React Native or Bun applications.

Quick Start

Use the sql skill to insert a new user with email '[email protected]' and name 'Test User' into the 'users' table.

Frequently Asked Questions about SQL Database Access

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write type-safe SQL queries in a TypeScript application?

To write type-safe SQL queries, use the Kysely query builder to construct database operations with full TypeScript support, catching errors at compile time. This approach abstracts raw SQL complexities and ensures data integrity during operations.

Can I use Kysely with Expo SQLite for React Native database management?

Yes, Kysely supports Expo SQLite for React Native database management. You must use the `kysely-expo` dialect to enable type-safe data storage, retrieval, and schema definition within your mobile application.

Does Kysely support Bun SQLite for backend database operations?

Yes, Kysely supports Bun SQLite for backend database operations. By utilizing the `kysely-bun-sqlite` dialect, you can securely manage application state and perform complex data manipulations within your Bun applications.

What is the best way to handle concurrent SQL database access in Kysely?

To handle concurrent SQL database access in Kysely, adhere to busy timeout pragmas. This ensures transactional integrity and secure data management when multiple operations attempt to access the database simultaneously.

How do I insert a new record into a SQL database using a type-safe query builder?

You can insert a new record into a SQL database by using the Kysely query builder to structure your insertion values, such as email and name into a 'users' table. This provides type safety and secure data management across different JavaScript runtimes.