create-bcp-app 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -162,13 +162,7 @@ The database choice adds starter configuration and the matching driver:
162
162
  - MongoDB: `mongodb`
163
163
  - None: no database dependency
164
164
 
165
- Server-only database helpers begin with:
166
-
167
- ```ts
168
- import "bcp/server-only";
169
- ```
170
-
171
- For MySQL, the generated helper exposes the BCP database primitives through `bcp/database`.
165
+ For **MySQL**, **PostgreSQL** and **SQLite**, generated `lib/database.ts` exposes the framework database primitives through `bcp/database`. Provider connections are managed behind the Database Platform v2 adapter layer instead of being created directly in the generated application.
172
166
 
173
167
  Generated MySQL environment variables:
174
168
 
@@ -180,6 +174,28 @@ DB_PASSWORD=
180
174
  DB_NAME=bcp_app
181
175
  ```
182
176
 
177
+ Generated PostgreSQL environment variable:
178
+
179
+ ```dotenv
180
+ DATABASE_URL=postgresql://postgres:password@localhost:5432/bcp_app
181
+ ```
182
+
183
+ Generated SQLite environment variable:
184
+
185
+ ```dotenv
186
+ DATABASE_URL=./data/bcp.sqlite
187
+ ```
188
+
189
+ `bcp/database` infers PostgreSQL from `postgres://` or `postgresql://` connection URLs. SQLite is inferred from `:memory:`, `sqlite:` / `file:` locations and common `.sqlite`, `.sqlite3` or `.db` file paths. Applications may also configure `DB_DRIVER` explicitly.
190
+
191
+ Placeholder syntax follows the selected provider:
192
+
193
+ ```text
194
+ MySQL ?
195
+ SQLite ?
196
+ PostgreSQL $1, $2, ...
197
+ ```
198
+
183
199
  The generator intentionally does not force an ORM.
184
200
 
185
201
  ## Storage providers
@@ -341,6 +357,8 @@ Examples:
341
357
 
342
358
  ```bash
343
359
  npx create-bcp-app my-app --tailwind --database mysql --auth jwt-cookie --storage local
360
+ npx create-bcp-app my-app --database postgresql
361
+ npx create-bcp-app my-app --database sqlite
344
362
  npx create-bcp-app my-app --storage amazon-s3
345
363
  npx create-bcp-app my-app --storage cloudflare-r2
346
364
  npx create-bcp-app my-app --no-tailwind --database mongodb
@@ -350,5 +368,5 @@ npx create-bcp-app my-app --yes
350
368
  The `--bcp` option is mainly for prerelease/local package verification:
351
369
 
352
370
  ```bash
353
- npx create-bcp-app my-app --bcp file:../chidchanun-bcp-0.1.29.tgz
371
+ npx create-bcp-app my-app --bcp file:../chidchanun-bcp-0.2.3.tgz
354
372
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bcp-app",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Create a new BCP Framework application.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.mjs CHANGED
@@ -388,7 +388,9 @@ function configureFrameworkDatabaseEntry(
388
388
  database
389
389
  ) {
390
390
  if (
391
- database !== "mysql"
391
+ database !== "mysql" &&
392
+ database !== "postgresql" &&
393
+ database !== "sqlite"
392
394
  ) {
393
395
  return;
394
396
  }