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

import "../../../../chunk-DHZ7AZKP.js";

// ../../boilerplates/d1/dist/files/$wrangler.toml.js
async function getToml(props) {
  const content = await props.readfile?.();
  if (!content) {
    throw new Error("wrangler.toml should not be empty");
  }
  const dbSnippet = `
# https://developers.cloudflare.com/d1/build-with-d1/local-development/#develop-locally-with-pages
[[d1_databases]]
binding = "DB" # Should match preview_database_id
database_name = "YOUR_DATABASE_NAME"
database_id = "the-id-of-your-D1-database-goes-here" # wrangler d1 info YOUR_DATABASE_NAME
preview_database_id = "DB" # Required for Pages local development
migrations_dir = "database/migrations"
`;
  return `${content}
${dbSnippet}`;
}
export {
  getToml as default
};
