Skip to content

Commit

Permalink
tweaks: executeRaw is the way
Browse files Browse the repository at this point in the history
  • Loading branch information
slvssb committed Nov 28, 2024
1 parent e56ef07 commit 0725a51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/useDrizzleStudio.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions build/useDrizzleStudio.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/useDrizzleStudio.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions src/useDrizzleStudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ export default function useDrizzleStudio(props: Props) {

data = await executed.getAllAsync()
} else {
const statement = props.db.prepareStatement(e.sql)
statement.bind(e.params)
const executed = await statement.execute()

if (e.arrayMode) {
data = executed.rows.map(row => Object.keys(row).map(key => row[key]))
data = await props.db.executeRaw(e.sql, e.params)
} else {
const executed = await props.db.execute(e.sql, e.params)
data = executed.rows
}
}
Expand Down

0 comments on commit 0725a51

Please sign in to comment.