#!/usr/bin/env node
import { createRequire as createRequire_BATI_CLI } from 'module';
const require = createRequire_BATI_CLI(import.meta.url);

import {
  Wxs
} from "../../../../chunk-KGXTM3D3.js";
import "../../../../chunk-IAWYWZSL.js";
import "../../../../chunk-DHZ7AZKP.js";

// ../../boilerplates/d1/dist/files/$README.md.js
async function getReadme(props) {
  const content = await Wxs(props);
  const todo = `
## *Cloudflare D1*

### Setup
Create a D1 database with the following command:
\`\`\`sh
wrangler d1 create <your-db-name>
\`\`\`

Then, copy the output to \`wrangler.toml\`.

Finally, update the \`${props.meta.BATI.has("drizzle") ? "drizzle" : "d1"}:migrate\` script (in \`package.json\`) to replace \`YOUR_DATABASE_NAME\`, and execute it.

> [!NOTE]
> For reference, a good database name is:
> - Typically a combination of ASCII characters, shorter than 32 characters, and uses dashes (-) instead of spaces.
> - Descriptive of the use-case and environment. For example, \u201Cstaging-db-web\u201D or \u201Cproduction-db-backend\u201D.
> - Only used for describing the database, and is not directly referenced in code.
`;
  content.addMarkdownFeature(todo, "sqlite", {
    position: "before"
  });
  return content;
}
export {
  getReadme as default
};
