Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS: SQL Resource - RDS MySQL Support #680

Open
JustAndrew-pixel opened this issue Sep 15, 2024 · 1 comment
Open

AWS: SQL Resource - RDS MySQL Support #680

JustAndrew-pixel opened this issue Sep 15, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JustAndrew-pixel
Copy link

Feature Request

Suggestion

Add support for RDS MySQL databases and additional migrations mechanism

Value

For some use cases like "distributed data storage" it's better to use MySQL, instead of PostgreSQL DB. In that case it would be great to create RDS MySql with nitric code + supported migrations, without doing the same manually in AWS dashboard.

Alternatives

Other info

@JustAndrew-pixel JustAndrew-pixel added the enhancement New feature or request label Sep 15, 2024
@jyecusch jyecusch changed the title Support of AWS RDS MySQL databases + migrations AWS: SQL Resource - RDS MySQL Support Sep 24, 2024
@jyecusch jyecusch added the good first issue Good for newcomers label Sep 27, 2024
@jyecusch
Copy link
Member

We probably want to consider allowing the resource request in the app code to specify the SQL dialect (since the app presumably relies on it).

For example, SQL like this is valid for Postgres, but not for MySQL:

CREATE TABLE items (
  id SERIAL PRIMARY KEY,
  in_stock BOOLEAN
);

MySQL would be something like this instead:

CREATE TABLE items (
  id INT AUTO_INCREMENT PRIMARY KEY,
  in_stock TINYINT(1)
);

A few proposals I can think of:

import { sql } from '@nitric/sdk'
// dialect param
const db = sql('my-database', 'MySQL')
import { sql } from '@nitric/sdk'
// opts param with dialect property
const db = sql('my-database', { dialect: 'MySQL' })
import { sql } from '@nitric/sdk'
// new methods for creating specific db types
const db = sql.postgres('my-database')

Curious what others think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants