File tree Expand file tree Collapse file tree 7 files changed +540
-2
lines changed
Expand file tree Collapse file tree 7 files changed +540
-2
lines changed Original file line number Diff line number Diff line change 22. * .swp
33dist /
44node_modules /
5+ fsql-dumps /
Original file line number Diff line number Diff line change @@ -66,6 +66,26 @@ Notes:
6666fsql
6767```
6868
69+ ## Export
70+
71+ Export your Forge SQL database schema and data to a local SQL file.
72+
73+ ``` sh
74+ fsql-export
75+ ```
76+
77+ Options:
78+
79+ - ` --schema-only ` : Export schema only (skip data)
80+ - ` --output <file> ` : Output file path (default: ` ./fsql-dumps/fsql-export-<timestamp>.sql ` )
81+ - ` --live-schema ` : Fetch DDL from live database instead of ` migration.ts `
82+
83+ Notes:
84+
85+ - uses ` FORGE_SQL_WEBTRIGGER ` from your ` .env ` file
86+ - exports schema and data to ` ./fsql-dumps/ ` by default
87+ - automatically looks for ` migration.ts ` to preserve your exact table definitions
88+
6989## Upgrade
7090
7191``` sh
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+ import "../dist/export.js" ;
Original file line number Diff line number Diff line change 1212 "types" : " dist/index.d.ts" ,
1313 "bin" : {
1414 "fsql" : " bin/fsql.js" ,
15- "fsql-setup" : " bin/setup.js"
15+ "fsql-setup" : " bin/setup.js" ,
16+ "fsql-export" : " bin/fsql-export.js"
1617 },
1718 "exports" : {
1819 "." : {
Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ export class ForgeClient {
4747 clearTimeout ( timeoutId ) ;
4848
4949 if ( ! response . ok ) {
50+ const contentType = response . headers . get ( "content-type" ) ;
51+ if ( contentType && contentType . includes ( "text/html" ) ) {
52+ return {
53+ error : `HTTP ${ response . status } ${ response . statusText } ` ,
54+ } ;
55+ }
56+
5057 const errorText = await response . text ( ) ;
5158 return {
5259 error : `HTTP ${ response . status } : ${ errorText } ` ,
You can’t perform that action at this time.
0 commit comments