You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Drizzle queries](https://github.com/powersync-ja/powersync-js/tree/main/packages/drizzle-driver) can be used with the `useQuery` and `useSuspenseQuery` hooks by converting them to a compilable query using the `toCompilableQuery` utility from `@powersync/drizzle-driver`.
query:toCompilableQuery(drizzleQuery), // The type of the rows in `data` are inferred from the Drizzle query
177
+
});
178
+
179
+
if (isLoading) {
180
+
return<div>Loading todo lists...</div>;
181
+
}
182
+
183
+
if (error) {
184
+
return<div>Error loading todo lists: {error.message}</div>;
185
+
}
186
+
187
+
return (
188
+
<ul>
189
+
{todoLists?.map((list) => (
190
+
<li key={list.id}>{list.name}</li>
191
+
))}
192
+
</ul>
193
+
);
194
+
};
195
+
```
196
+
197
+
The `toCompilableQuery` function wraps your Drizzle query to make it compatible with useQuery and useSuspenseQuery.
198
+
199
+
For more information on using Drizzle with PowerSync, see the [Drizzle Driver documentation](https://github.com/powersync-ja/powersync-js/tree/main/packages/drizzle-driver).
0 commit comments