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

Feature/adapt drizzle kit #7

Merged
merged 5 commits into from
Aug 13, 2024
Merged

Feature/adapt drizzle kit #7

merged 5 commits into from
Aug 13, 2024

Conversation

Rodriguespn
Copy link
Collaborator

@Rodriguespn Rodriguespn commented Aug 8, 2024

Description

This PR allows us to generate migrations via generateSingleStoreTable, via Drizzle migrations, which was not possible previously. For the hackathon, we were either creating the tables and the schema on SingleStore Portal or via the generateMySqlTable function.
We still need to add the new columns support to the 'drizzle-kit`.

Work done

  • Upgrade mysql2 version from 2.3.3 to 3.3.3 to be compatible with the [email protected] used in the drizzle-orm/singlestore
  • Adapt all MySql references to SingleStore
  • Generate JSON migration files for SingleStore
  • Test generation of migration files and creation/update/removal of singlestore tables

Test Pipeline

image

Future Work

Allow drizzle-kit to support singlestore types:

  • BSON
  • Blob
  • UUID
  • GUID
  • Vector
  • GeoPoint

@Rodriguespn Rodriguespn added the enhancement New feature or request label Aug 8, 2024
@Rodriguespn Rodriguespn self-assigned this Aug 8, 2024
console.log(wrapParam('host', options.host));
console.log(wrapParam('port', options.port, true));
console.log(wrapParam('user', options.user, true));
console.log(wrapParam('password', options.password, true, 'secret'));

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to password
as clear text.

statement += it.generated
? `.generatedAlwaysAs(sql\`${
it.generated.as.replace(

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
`singlestore://${credentials.user}:${credentials.password}@${credentials.host}:${credentials.port}/${credentials.database}`;
}

const dbHash = createHash('sha256').update(dbUrl).digest('hex');

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort High

Password from
an access to password
is hashed insecurely.
drizzle-kit/package.json Show resolved Hide resolved
drizzle-kit/src/cli/commands/migrate.ts Outdated Show resolved Hide resolved
drizzle-kit/src/cli/connections.ts Show resolved Hide resolved
drizzle-kit/src/cli/validations/outputs.ts Show resolved Hide resolved
drizzle-kit/src/cli/commands/migrate.ts Outdated Show resolved Hide resolved
drizzle-kit/src/cli/commands/migrate.ts Outdated Show resolved Hide resolved
drizzle-kit/src/cli/validations/outputs.ts Show resolved Hide resolved
drizzle-kit/src/cli/commands/migrate.ts Outdated Show resolved Hide resolved
drizzle-kit/src/cli/connections.ts Show resolved Hide resolved
@Rodriguespn Rodriguespn force-pushed the feature/adapt-drizzle-kit branch from 5fc2bec to 8084ad6 Compare August 13, 2024 10:11
@Rodriguespn Rodriguespn merged commit 052d62c into main Aug 13, 2024
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants