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

db: add db/triggers changes back in, fix issues with drizzle-orm package #4330

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

patosullivan
Copy link
Member

The issue we were seeing was caused by two problems with drizzle-orm:

  1. lingering executeAsync and executeAsyncRaw uses.
  2. a bug in drizzle-orm w/the way it attempts to create migration tables in sqlite: Fix schema of all SQLite migration tables drizzle-team/drizzle-orm#2958

Copy link
Member

@arthyn arthyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions but mostly looks good to me, @dnbrwstr should probably review though

@@ -64,11 +64,6 @@ export default function ChannelScreen(props: Props) {
const channelIsPending = !channel || channel.isPendingChannel;
useFocusEffect(
useCallback(() => {
if (!channelIsPending) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this intentionally changed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I found that keeping this in the useFocusEffect caused unnecessary syncs that would then trigger unnecessary react query invalidations through the change listener.

const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
- return this.client.executeRawAsync(this.query.sql, params);
+ return this.client.executeRaw(this.query.sql, params);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these need to be synchronous?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the async methods don't actually exist

@arthyn arthyn self-requested a review January 17, 2025 16:30
Copy link
Member

@arthyn arthyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm would be good to have @dnbrwstr take a look too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants