-
Notifications
You must be signed in to change notification settings - Fork 1
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
Integration with Drizzle ORM #12
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Create @gqloom/drizzle package - Implement DrizzleWeaver class for integrating Drizzle ORM with GQLoom - Add type definitions and helper methods for Drizzle tables - Include test schema and configuration files
- Update drizzle-orm dependency from 0.38.2 to 0.38.3 - Add 'push' script to package.json for drizzle-kit push command
- Deleted the entire types.ts file from the drizzle package - This file was likely an old temporary typings file that is no longer needed
- Change test configuration to exclude all files named .config.ts instead of just vitest.config.ts - This modification ensures broader coverage for configuration files in testing
- Update @prisma/client from 5.20.0 to ^6.1.0 - Update ts-morph from ^23.0.0 to ^25.0.0 - Update related dependencies in package.json and pnpm-lock.yaml
- Add 'schema' property to UserModel object in the Prisma schema test - Set 'schema' property to null, indicating no schema is defined for the User model
- Refactor getColumnType method to handle array types more efficiently - Add support for PgVector and PgGeometry types - Implement error handling for unsupported column types - Add comprehensive test cases for PostgreSQL and SQLite table and column types
- Implement DrizzleWeaver.config method to allow custom configurations - Add presetGraphQLType option for defining custom scalar types - Update tests to cover new functionality
- Add insert input type generation for Drizzle tables - Update GraphQL type naming convention for tables - Introduce new utility functions for type mapping and naming
- Implement updateInput() method to generate UpdateInput type for a table - Add memoization to prevent duplicate type creation - Update test to cover new UpdateInput type generation
- Implement columnFilters method to generate filter types for each column - Add support for various comparison operators (eq, ne, lt, lte, gt, gte) - Include string-specific filters (like, ilike, notLike, notIlike) - Implement array-based filters (inArray, notInArray) - Add null checks (isNull, isNotNull) - Create and memoize filter types to avoid duplicates
- Add Filters type generation for tables - Include OR condition support in filters - Update columnFilters to static method - Add test case for Filters type generation
- Rename DrizzleInputWeaver to DrizzleInputFactory - Update related file names and import statements - Modify test suite to reflect the new class name
- Update all instances of TModalSilk to TModelSilk in type definitions - Update related interfaces and methods to use the new TModelSilk type - This change improves consistency and clarity in the type naming convention
- Implement selectArrayArgs() method in DrizzleInputFactory - Add Filters and ColumnFilters interfaces - Implement extractFilters and extractOrderBy methods in DrizzleResolverFactory - Update selectArrayQuery() method to handle new filtering and ordering options - Modify schema to use 'user' instead of 'users_table'
- Update input type to use InferSelectArrayOptions - Wrap result in StandardSchemaV1.SuccessResult - Modify selectArrayArgsToOptions to return new type
- Update filter type usage in input-factory and resolver-factory - Remove unique constraint from email column in test schema - Add comprehensive tests for selectArrayQuery with orderBy and filters - Fix logic for handling OR conditions in filters
- Add test case for gte and lt operators - Add test case for invalid column operator usage
- Introduce valibot for input validation - Implement custom input handling in resolver factory - Update dependencies and adjust project structure
- Add postinstall script to package.json - Automatically runs 'pnpm push' after installation
- Inserted an empty line in the DrizzleResolverFactory class - Improved code organization and readability
- Add InsertArrayArgs type and update input factory - Create abstract DrizzleResolverFactory class with insertArrayMutation method - Implement insertArrayMutation for MySQL, PostgreSQL, and SQLite - Update test to use new DrizzleResolverFactory.create method
- Implement insertArrayMutation for MySQL, PostgreSQL, and SQLite - Add MutationResult type and update related interfaces - Refactor resolver factory to handle different database types - Update tests to use SQLite resolver factory
- Rename schema file from 'db/schema.ts' to 'test/schema/sqlite.ts' - Update database URL in drizzle.config.ts - Modify resolver-factory.spec.ts to use new schema and database path - Update .gitignore to exclude all .db files in test directory
- Add MySQL 9.1 and PostgreSQL 17.2 services to docker-compose.yml - Configure environment variables for easy testing - Set up persistent data volumes for both databases - Expose ports 3306 (MySQL) and 5432 (PostgreSQL) for external access
- Add MySQL and PostgreSQL configurations - Update Docker Compose file for MySQL and PostgreSQL - Modify package.json to include new dependencies - Create new schema files for MySQL and PostgreSQL - Update existing schema file for SQLite
- Add 'Init docker' step to start Docker Compose before build - Ensures Docker services are running for the CI/CD pipeline
- Replace 'docker-compose' with 'docker compose' in the CI workflow - This change aligns the CI command with the new Docker CLI syntax
- Updated the name of the GraphQL mutation result type to MutationSuccessResult - Modified the test file to use a more generic schema import - Updated type references and imports to use the new schema name
- Add a private _output property to cache the resolver output - Modify the output getter to lazily initialize and return the cached output - Update selectArrayQuery, selectSingleQuery, and insertArrayMutation to use the new output property - Remove redundant DrizzleWeaver.unravel calls in resolver methods
- Add unit tests for DrizzleMySQLResolverFactory and DrizzlePostgresResolverFactory - Update configuration files to use environment variables for database URLs - Refactor resolver factory to support different database types - Add test cases for insertArrayMutation in MySQL, PostgreSQL, and SQLite
- Update @mikro-orm/better-sqlite from 6.2.8 to 6.4.3 - Update @mikro-orm/core from 6.2.8 to 6.4.3
- Implement InsertSingleArgs interface for single item insert input - Add insertSingleMutation method to DrizzleResolverFactory - Implement insertSingleMutation for MySQL, PostgreSQL, and SQLite - Update tests to cover new insertSingleMutation functionality
- Implement updateArgs method in DrizzleInputFactory - Add UpdateArgs interface and related types - Implement updateMutation method in DrizzleResolverFactory - Update DrizzleMySQLResolverFactory, DrizzlePostgresResolverFactory, and DrizzleSQLiteResolverFactory to support update mutations - Add tests for update mutation functionality
- Implement deleteMutation method for MySQL, PostgreSQL, and SQLite - Create DeleteArgs interface and update resolver factory to use it - Add tests for deleteMutation to ensure correct functionality
- Add type inference for table names and query builders - Implement factory methods for creating resolver factories - Update tests to use new factory methods and schema definitions - Add relations to SQLite schema for testing
…reSQL - Add relations for users and posts in MySQL schema - Add relations for users and posts in PostgreSQL schema - Implement one-to-many relationship between users and posts - Define foreign key constraints for post-author relationship
- Implement relationField method for DrizzleResolverFactory - Add support for one-to-many and many-to-one relations - Update schema to include course and studentToCourse tables - Add tests for relationField functionality
- Added a TODO comment in the resolver factory code - Reminder to implement Dataloader for improved performance
- Use EasyDataLoader in DrizzleResolverFactory for relation fields - Implement batch loading for relation fields to improve performance - Add tests for new DataLoader implementation
- Add retry option to the test to handle potential race conditions - Improve test reliability by allowing for retries in case of failures
- Add capitalize function to string utilities - Implement resolver method in DrizzleResolverFactory - Update related test files to cover new functionality
- Update orderBy field to use GraphQLList and GraphQLNonNull - Add support for cascade delete in SQLite, MySQL, and PostgreSQL schemas - Update resolver factory to use loom.resolver.of instead of loom.resolver - Modify insertSingleMutation to accept value as an object - Update test to use describe.concurrent and add retry to flaky test - Add graphql-yoga as a dependency
- Rename "post" table to "drizzle_post" in MySQL and PostgreSQL test schemas - This change ensures consistent table naming across different database types
- Create test schema for PostgreSQL - Implement unit tests for GraphQL resolver using Drizzle ORM - Cover CRUD operations for users and posts - Add test cases for querying users with posts - Verify correct weaving of GraphQL schema
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.