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

Beta #3503

Merged
merged 21 commits into from
Nov 6, 2024
Merged

Beta #3503

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
188a141
Fix breakpoints option default value
klotztech Oct 25, 2024
afbbba3
fix: added commonly used columns to supabase auth.users table schema
Nov 1, 2024
67c68fb
imports checker with OHM grammar
AlexBlokh Nov 3, 2024
e68aebb
Merge remote-tracking branch 'origin/main'
AlexBlokh Nov 3, 2024
298d20c
Merge branch 'beta' into main
AndriiSherman Nov 3, 2024
a52d7ab
Merge pull request #3395 from drizzle-team/main
AndriiSherman Nov 3, 2024
cd33310
imports checker with OHM grammar + fix of imports issues
AlexBlokh Nov 3, 2024
945aa4f
Merge branch 'beta' into imports-checker
AndriiSherman Nov 3, 2024
cfa88dd
Formatting fix
Sukairo-02 Nov 3, 2024
5f09e04
Merge pull request #3397 from drizzle-team/imports-checker
AndriiSherman Nov 3, 2024
a0bfd0b
Merge branch 'beta' into bugfix/3327-missing-supabase-table-columns
AndriiSherman Nov 3, 2024
e1194ce
Merge pull request #3328 from nicholasdly/bugfix/3327-missing-supabas…
AndriiSherman Nov 3, 2024
912be68
Merge branch 'beta' into main
AndriiSherman Nov 3, 2024
d43eee3
Merge pull request #3200 from klotztech/main
AndriiSherman Nov 3, 2024
19f042a
[MySQL] Add unsigned floating point types + Fix unsigned integer type…
L-Mario564 Nov 3, 2024
998119e
Batch of bugfixes for ORM (#3181)
L-Mario564 Nov 4, 2024
462954f
main to beta (#3404)
AndriiSherman Nov 4, 2024
4d56096
feat: add tablesFilter to pushSchema api (#3141)
DanRibbens Nov 4, 2024
3f6d468
Merge pull request #3501 from drizzle-team/main
AndriiSherman Nov 6, 2024
96d338b
Batch of bugfixes for Kit (#2959)
L-Mario564 Nov 6, 2024
c30d4f0
Bump versions
AndriiSherman Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions changelogs/drizzle-kit/0.28.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Improvements

- Added an OHM static imports checker to identify unexpected imports within a chain of imports in the drizzle-kit repo. For example, it checks if drizzle-orm is imported before drizzle-kit and verifies if the drizzle-orm import is available in your project.
- [Adding more columns to Supabase auth.users table schema](https://github.com/drizzle-team/drizzle-orm/issues/3327) - thanks @nicholasdly

# Bug Fixes

- [[BUG]: [drizzle-kit]: Fix breakpoints option cannot be disabled](https://github.com/drizzle-team/drizzle-orm/issues/2828) - thanks @klotztech
- [[BUG]: drizzle-kit introspect: SMALLINT import missing and incorrect DECIMAL UNSIGNED handling](https://github.com/drizzle-team/drizzle-orm/issues/2950) - thanks @L-Mario564
- [Unsigned tinyints preventing migrations](https://github.com/drizzle-team/drizzle-orm/issues/1571) - thanks @L-Mario564
- [[BUG]: Can't parse float(8,2) from database (precision and scale and/or unsigned breaks float types)](https://github.com/drizzle-team/drizzle-orm/issues/3285) - thanks @L-Mario564
- [[BUG]: PgEnum generated migration doesn't escape single quotes](https://github.com/drizzle-team/drizzle-orm/issues/1272) - thanks @L-Mario564
- [[BUG]: single quote not escaped correctly in migration file](https://github.com/drizzle-team/drizzle-orm/issues/2184) - thanks @L-Mario564
- [[BUG]: Migrations does not escape single quotes](https://github.com/drizzle-team/drizzle-orm/issues/1765) - thanks @L-Mario564
- [[BUG]: Issue with quoted default string values](https://github.com/drizzle-team/drizzle-orm/issues/2122) - thanks @L-Mario564
- [[BUG]: SQl commands in wrong roder](https://github.com/drizzle-team/drizzle-orm/issues/2390) - thanks @L-Mario564
- [[BUG]: Time with precision in drizzle-orm/pg-core adds double-quotes around type](https://github.com/drizzle-team/drizzle-orm/issues/1804) - thanks @L-Mario564
- [[BUG]: Postgres push fails due to lack of quotes](https://github.com/drizzle-team/drizzle-orm/issues/2396) - thanks @L-Mario564
- [[BUG]: TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')](https://github.com/drizzle-team/drizzle-orm/issues/2344) - thanks @L-Mario564
- [[BUG]: drizzle-kit introspect generates CURRENT_TIMESTAMP without sql operator on date column](https://github.com/drizzle-team/drizzle-orm/issues/2899) - thanks @L-Mario564
- [[BUG]: Drizzle-kit introspect doesn't pull correct defautl statement](https://github.com/drizzle-team/drizzle-orm/issues/2905) - thanks @L-Mario564
- [[BUG]: Problem on MacBook - This statement does not return data. Use run() instead](https://github.com/drizzle-team/drizzle-orm/issues/2623) - thanks @L-Mario564
- [[BUG]: Enum column names that are used as arrays are not quoted](https://github.com/drizzle-team/drizzle-orm/issues/2598) - thanks @L-Mario564
- [[BUG]: drizzle-kit generate ignores index operators](https://github.com/drizzle-team/drizzle-orm/issues/2935) - thanks @L-Mario564
- [dialect param config error message is wrong](https://github.com/drizzle-team/drizzle-orm/issues/3427) - thanks @L-Mario564
- [[BUG]: Error setting default enum field values](https://github.com/drizzle-team/drizzle-orm/issues/2299) - thanks @L-Mario564
- [[BUG]: drizzle-kit does not respect the order of columns configured in primaryKey()](https://github.com/drizzle-team/drizzle-orm/issues/2326) - thanks @L-Mario564
- [[BUG]: Cannot drop Unique Constraint MySQL](https://github.com/drizzle-team/drizzle-orm/issues/998) - thanks @L-Mario564
6 changes: 6 additions & 0 deletions changelogs/drizzle-orm/0.36.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Bug Fixes

- [[BUG]: Using sql.placeholder with limit and/or offset for a prepared statement produces TS error](https://github.com/drizzle-team/drizzle-orm/issues/2146) - thanks @L-Mario564
- [[BUG] If a query I am trying to modify with a dynamic query (....$dynamic()) contains any placeholders, I'm getting an error that says No value for placeholder.... provided](https://github.com/drizzle-team/drizzle-orm/issues/2272) - thanks @L-Mario564
- [[BUG]: Error thrown when trying to insert an array of new rows using generatedAlwaysAsIdentity() for the id column](https://github.com/drizzle-team/drizzle-orm/issues/2849) - thanks @L-Mario564
- [[BUG]: Unable to Use BigInt Types with Bun and Drizzle](https://github.com/drizzle-team/drizzle-orm/issues/2603) - thanks @L-Mario564
1 change: 1 addition & 0 deletions drizzle-kit/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
**/.DS_Store

!src
!imports-checker
!tests
!vitest.config.ts
!README.md
Expand Down
78 changes: 78 additions & 0 deletions drizzle-kit/imports-checker/analyze.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { readFileSync } from 'fs';
import type { Node } from 'ohm-js';
import JSImports from './grammar/grammar.ohm-bundle';

export type CollectionItem = {
type: 'data' | 'types';
source: string;
};

function recursiveRun(...args: Node[]): boolean {
for (const arg of args) {
if (
arg.ctorName === 'Rest'
|| arg.ctorName === 'comment'
|| arg.ctorName === 'stringLiteral'
) {
continue;
}

if (
arg.ctorName === 'ImportExpr_From'
|| arg.ctorName === 'ImportExpr_NoFrom'
) {
arg['analyze']();

continue;
}

if (arg.isTerminal()) continue;

for (const c of arg.children) {
if (!recursiveRun(c)) return false;
}
}

return true;
}
function init(collection: CollectionItem[]) {
const semantics = JSImports.createSemantics();

semantics.addOperation('analyze', {
JSImports(arg0, arg1) {
recursiveRun(arg0, arg1);
},

ImportExpr_From(kImport, importInner, kFrom, importSource) {
const ruleName = importInner.children[0]!.ctorName;
const importType = ruleName === 'ImportInner_Type' || ruleName === 'ImportInner_Types'
? 'types'
: 'data';

collection.push({
source: importSource.children[1]!.sourceString!,
type: importType,
});
},

ImportExpr_NoFrom(kImport, importSource) {
collection.push({
source: importSource.children[1]!.sourceString!,
type: 'data',
});
},
});

return semantics;
}

export function analyze(path: string) {
const file = readFileSync(path).toString();
const match = JSImports.match(file, 'JSImports');

if (match.failed()) throw new Error(`Failed to parse file: ${path}`);
const collection: CollectionItem[] = [];

init(collection)(match)['analyze']();
return collection;
}
Loading
Loading