diff options
Diffstat (limited to 'packages/db/test/fixtures/static-remote/src')
-rw-r--r-- | packages/db/test/fixtures/static-remote/src/pages/index.astro | 19 | ||||
-rw-r--r-- | packages/db/test/fixtures/static-remote/src/pages/run.astro | 17 |
2 files changed, 36 insertions, 0 deletions
diff --git a/packages/db/test/fixtures/static-remote/src/pages/index.astro b/packages/db/test/fixtures/static-remote/src/pages/index.astro new file mode 100644 index 000000000..849e65d18 --- /dev/null +++ b/packages/db/test/fixtures/static-remote/src/pages/index.astro @@ -0,0 +1,19 @@ +--- +import { User, db } from 'astro:db'; + +const users = await db.select().from(User); +--- + +<html> + <head> + <title>Testing</title> + </head> + <body> + <h1>Testing</h1> + + <h2>Users</h2> + <ul> + {users.map((user) => <li>{user.name}</li>)} + </ul> + </body> +</html> diff --git a/packages/db/test/fixtures/static-remote/src/pages/run.astro b/packages/db/test/fixtures/static-remote/src/pages/run.astro new file mode 100644 index 000000000..2f2ac1cce --- /dev/null +++ b/packages/db/test/fixtures/static-remote/src/pages/run.astro @@ -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> |