-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inconsistent results from raw SQL (#11091)
* Fix inconsistent results from raw SQL * Remove .only * Fix * Update packages/db/src/runtime/db-client.ts Co-authored-by: Ben Holmes <hey@bholmes.dev> --------- Co-authored-by: Ben Holmes <hey@bholmes.dev>
- Loading branch information
1 parent
b78e83f
commit e14ce57
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@astrojs/db": patch | ||
--- | ||
|
||
Fix inconsistent result type using raw SQL |
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
17 changes: 17 additions & 0 deletions
17
packages/db/test/fixtures/static-remote/src/pages/run.astro
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import { User, db, sql } from 'astro:db'; | ||
const results = await db.run(sql`SELECT 1 as value`); | ||
const row = results.rows[0]; | ||
--- | ||
|
||
<html> | ||
<head> | ||
<title>Testing</title> | ||
</head> | ||
<body> | ||
<h1>Testing</h1> | ||
|
||
<span id="row">{row.value}</span> | ||
</body> | ||
</html> |
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