-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Extra Config Builder chokes if there are not extra config columns. #14
Comments
Appreciate all the info provided. I haven't updated this package to be compatible with Drizzle's new index API, which seems to be the cause for the error here. Your PR doesn't seem like a definitive solution to this issue, but I'll keep it open in the meantime, in case I need it as reference. |
Can't seem to replicate the issue. Could you provide me the definition for |
I have several other tables that don't have an issue that also use this defaultfields function to get fields I would use on basically every table. It's only the tables that have extra configs that error out. Again Thanks for developing this. At the very least I used my workaround so that it didn't crash and I was able to get an output. I will watch for when this gets updated with drizzles new index API. |
|
I see you're exporting the UserRole Typescript enum. Could you try moving that elsewhere so the when importing |
@johnkraczek Should be fixed in latest release. |
I found this library and thought it was very cool, so thanks for making it. 👍 😁
I ran into an issue and wanted to report it, as well as my current workaround.
It seems to be an issue with the extraConfigBuilder & extraConfigColumns
Let me get into my setup.
My schema has next auth tables directly from what they recommend in their documentation for example the Account Provider Table that looks like this:
schemas/provider-account.ts (drizzle schema table)
utils/dbml.ts (the file to define my drizzle setup and generate the DBML)
When I run the code with that table included in the schema then it chokes with this error:
Console log of the table object (common.ts around line 134)
Additional logging showed that the array of columns for the indexes existed but each element was undefined:
Here's the output:
This is getting passed to the wrapColumns function and if the columns are undefined then it crashes.
** Ultimately I'm not sure if the table data is getting produced by drizzle itself and thus we would have to fix the errors downstream or if this library is generating the data and producing bad column data, or also very possibly, my drizzle config is wrong and its not generating the tables correctly. **
In the end, the easiest fix for me was to just have the wrapColumns class check if it was getting undefined columns and then return an empty string if it was. As this is mostly a quick and dirty way for me to convert my drizzle schema's to a close approximation visual representation that seems to work for me, although it certanly looks like the output is sans the [PK] symbols,
I have made a pull request to update the wrap columns to check if it's getting undefined data so that I can at least have it finish its output.
Let me know if you see something obvious I'm missing.
The text was updated successfully, but these errors were encountered: