Skip to content

Add MySQL support to neko-sql using mysql2#143

Merged
devbro1 merged 29 commits intomasterfrom
copilot/add-mysql-support
Jan 10, 2026
Merged

Add MySQL support to neko-sql using mysql2#143
devbro1 merged 29 commits intomasterfrom
copilot/add-mysql-support

Conversation

Copy link
Contributor

Copilot AI commented Dec 20, 2025

Description

Adds MySQL database support to neko-sql using the mysql2 library, following the existing PostgreSQL and SQLite implementation patterns.

Implementation:

  • MysqlConnection: Connection pooling, transactions (BEGIN/COMMIT/ROLLBACK), database management operations, identifier validation/escaping
  • MysqlQueryGrammar: Standard query compilation with MySQL-specific insertGetId handling
  • MysqlSchemaGrammar: Overrides serial type to compile as INT AUTO_INCREMENT NOT NULL instead of PostgreSQL's serial

Usage:

import { MysqlConnection } from '@devbro/neko-sql';

const conn = new MysqlConnection({
  host: 'localhost',
  database: 'mydb',
  user: 'myuser',
  password: 'mypassword',
  port: 3306,
});

await conn.connect();
const query = conn.getQuery();
const results = await query.table('users').whereOp('id', '=', 1).get();
await conn.disconnect();

Checklist

  • lint/prettier
  • updated docs with new feature/details
  • added tests that cover changes
  • Add jsdocs for any added function/class

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • undefined
    • Triggering command: /usr/lib/postgresql/16/bin/psql /usr/lib/postgresql/16/bin/psql --host undefined --user undefined --port 5432 postgres -c CREATE DATABASE test_db_tj9xdo (dns block)
    • Triggering command: /usr/lib/postgresql/16/bin/psql /usr/lib/postgresql/16/bin/psql --host undefined --user undefined --port 5432 postgres -c CREATE DATABASE test_db_nfvfka (dns block)
    • Triggering command: /usr/lib/postgresql/16/bin/psql /usr/lib/postgresql/16/bin/psql --host undefined --user undefined --port 5432 postgres -c CREATE DATABASE test_db_kpav93 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>neko-sql add support for mysql</issue_title>
<issue_description>use mysql2 library</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 20, 2025 17:47
Co-authored-by: devbro1 <29712935+devbro1@users.noreply.github.com>
Co-authored-by: devbro1 <29712935+devbro1@users.noreply.github.com>
…ol config access

Co-authored-by: devbro1 <29712935+devbro1@users.noreply.github.com>
Co-authored-by: devbro1 <29712935+devbro1@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for MySQL using mysql2 library Add MySQL support to neko-sql using mysql2 Dec 20, 2025
Copilot AI requested a review from devbro1 December 20, 2025 17:58
devbro1 and others added 19 commits January 9, 2026 21:10
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
@devbro1 devbro1 marked this pull request as ready for review January 10, 2026 19:06
devbro1 and others added 4 commits January 10, 2026 19:18
branch name: copilot/add-mysql-support
branch name: copilot/add-mysql-support
@devbro1 devbro1 merged commit c7766af into master Jan 10, 2026
@devbro1 devbro1 deleted the copilot/add-mysql-support branch January 31, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

neko-sql add support for mysql

2 participants