postgresdk 0.4.0 → 0.5.1-alpha.0
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 +15 -1
- package/dist/cli.js +365 -144
- package/dist/core/operations.d.ts +65 -0
- package/dist/emit-core-operations.d.ts +4 -0
- package/dist/emit-include-loader.d.ts +1 -1
- package/dist/emit-router-hono.d.ts +5 -0
- package/dist/emit-routes-hono.d.ts +11 -0
- package/dist/index.js +350 -144
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -139,7 +139,7 @@ All from your existing database schema. No manual coding required.
|
|
139
139
|
- 🔗 **Smart Relationships** - Automatic handling of 1:N and M:N relationships with eager loading
|
140
140
|
- 🔐 **Built-in Auth** - API key and JWT authentication with zero configuration
|
141
141
|
- 🎯 **Zero Config** - Works out of the box with sensible defaults
|
142
|
-
- 🏗️ **Framework Ready** - Server routes
|
142
|
+
- 🏗️ **Framework Ready** - Server routes for Hono (Express & Fastify coming soon), client SDK works anywhere
|
143
143
|
- 📦 **Lightweight** - Minimal dependencies, optimized bundle size with shared BaseClient
|
144
144
|
- 🔄 **SDK Distribution** - Built-in SDK bundling and pull mechanism for easy client distribution
|
145
145
|
|
@@ -218,6 +218,8 @@ export default {
|
|
218
218
|
softDeleteColumn: null, // Column name for soft deletes (e.g., "deleted_at")
|
219
219
|
includeDepthLimit: 3, // Max depth for nested includes
|
220
220
|
dateType: "date", // "date" | "string" - How to handle timestamps
|
221
|
+
serverFramework: "hono", // "hono" | "express" | "fastify" (currently only hono)
|
222
|
+
useJsExtensions: false, // Add .js to imports (for Vercel Edge, Deno)
|
221
223
|
|
222
224
|
// Authentication (optional) - simplified syntax
|
223
225
|
auth: {
|
@@ -522,6 +524,18 @@ app.route("/", apiRouter);
|
|
522
524
|
|
523
525
|
For edge environments like Vercel Edge Functions or Cloudflare Workers. Uses HTTP/WebSocket instead of TCP connections.
|
524
526
|
|
527
|
+
Configuration for Vercel Edge:
|
528
|
+
```typescript
|
529
|
+
// postgresdk.config.ts
|
530
|
+
export default {
|
531
|
+
connectionString: process.env.DATABASE_URL,
|
532
|
+
serverFramework: "hono", // Hono is edge-compatible
|
533
|
+
useJsExtensions: true, // Required for Vercel Edge
|
534
|
+
dateType: "string", // Better for JSON serialization
|
535
|
+
auth: { apiKey: process.env.API_KEY }
|
536
|
+
};
|
537
|
+
```
|
538
|
+
|
525
539
|
Server setup:
|
526
540
|
```typescript
|
527
541
|
import { Hono } from "hono";
|