mirror of
https://github.com/withastro/astro.git
synced 2025-04-07 23:41:43 -05:00
[ci] format
This commit is contained in:
parent
6576f5d458
commit
44dacedb3a
5 changed files with 7 additions and 10 deletions
|
@ -41,9 +41,9 @@ export function vitePluginDb(params: VitePluginDBParams): VitePlugin {
|
|||
return {
|
||||
name: 'astro:db',
|
||||
enforce: 'pre',
|
||||
configResolved(resolvedConfig) {
|
||||
configResolved(resolvedConfig) {
|
||||
command = resolvedConfig.command;
|
||||
},
|
||||
},
|
||||
async resolveId(id, rawImporter) {
|
||||
if (id !== VIRTUAL_MODULE_ID) return;
|
||||
if (params.connectToStudio) return resolved.virtual;
|
||||
|
@ -147,7 +147,7 @@ export function getStudioVirtualModContents({
|
|||
isBuild: boolean;
|
||||
}) {
|
||||
function appTokenArg() {
|
||||
if(isBuild) {
|
||||
if (isBuild) {
|
||||
// In production build, always read the runtime environment variable.
|
||||
return 'process.env.ASTRO_STUDIO_APP_TOKEN';
|
||||
} else {
|
||||
|
|
|
@ -36,8 +36,8 @@ const remoteResultSchema = z.object({
|
|||
});
|
||||
|
||||
export function createRemoteDatabaseClient(appToken: string, remoteDbURL: string) {
|
||||
if(appToken == null) {
|
||||
throw new Error(`Cannot create a remote client: missing app token.`)
|
||||
if (appToken == null) {
|
||||
throw new Error(`Cannot create a remote client: missing app token.`);
|
||||
}
|
||||
|
||||
const url = new URL('/db/query', remoteDbURL);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { column, defineDb, defineTable } from 'astro:db';
|
||||
|
||||
|
||||
const User = defineTable({
|
||||
columns: {
|
||||
id: column.text({ primaryKey: true, optional: false }),
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
|
||||
export default function() {
|
||||
|
||||
}
|
||||
export default function () {}
|
||||
|
|
|
@ -5,6 +5,7 @@ import { db, User } from 'astro:db';
|
|||
// Just for the side-effect of running all the code
|
||||
await db.select().from(User);
|
||||
---
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Testing</title>
|
||||
|
|
Loading…
Add table
Reference in a new issue