Rihan
Rihan
Explore posts from servers
NNuxt
Created by eddy401 on 11/13/2024 in #❓・help
Assign DNS records to specific preview deployments in NuxtHub
Sorry for the late reply - be sure to join the dedicated NuxtHub Discord :)
11 replies
NNuxt
Created by eddy401 on 11/13/2024 in #❓・help
Assign DNS records to specific preview deployments in NuxtHub
Hi @eddy401, this is possible! 😃 https://developers.cloudflare.com/pages/configuration/preview-deployments/#preview-aliases Essentially, all branches are accessible like <branch>.<project>.pages.dev. You can create a CNAME record pointing to that for a fixed (sub)domain for previewing. For example CNAME staging.example.com -> staging.example.pages.dev.
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
Is there any rough timeline for the new implementation?
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
Ahh I see, thank you very much for letting me know 😃
11 replies
NNuxt
Created by Mizael Xavier on 10/9/2024 in #❓・help
Deploy Error
Are you still facing the issue?
3 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
Also, it seems like any comments cannot be parsed within Miniflare's .exec() so my working example above only applies to deployed Workers, and not local development.
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
The two queries I'm running (shown above) are separated with \n. Is it intentional that any individual query cannot span across multiple lines too? With the migrations example on docs (which is also my scenario), it'd be common to see multi-line queries within them for readability.
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
Thank you for getting back to me 😃
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
Making the CREATE TABLE statement into a single line:
{"count":2,"duration":0.555}
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
No description
11 replies
CDCloudflare Developers
Created by Rihan on 10/21/2024 in #d1-database
I'm trying to run multiple SQL
Here's a minimal repro
CREATE TABLE IF NOT EXISTS hub_migrations (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT UNIQUE,
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
);`
CREATE TABLE IF NOT EXISTS hub_migrations (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT UNIQUE,
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
);`
export default {
async fetch(request, env) {
const { pathname } = new URL(request.url);

if (pathname === "/testing") {
const query = `-- Migration number: 0001 2024-10-21T06:45:41.702Z
CREATE TABLE todos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);

INSERT INTO hub_migrations (name) values ('0000_create-todos');
`

// const statement = env.DB.prepare(query)
// const result = await statement.raw()

const result = await env.DB.exec(query)
return Response.json(result);
}

return new Response("");
},
}
export default {
async fetch(request, env) {
const { pathname } = new URL(request.url);

if (pathname === "/testing") {
const query = `-- Migration number: 0001 2024-10-21T06:45:41.702Z
CREATE TABLE todos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);

INSERT INTO hub_migrations (name) values ('0000_create-todos');
`

// const statement = env.DB.prepare(query)
// const result = await statement.raw()

const result = await env.DB.exec(query)
return Response.json(result);
}

return new Response("");
},
}
11 replies
NNuxt
Created by /home/devNaimul on 9/12/2024 in #❓・help
My IDE Don't Give me any Suggestion
Are you using version 2.1.6 of the Vue extension?
5 replies