@@ -23,6 +23,7 @@ describe("d1", () => {
23
23
wrangler d1 delete <name> Delete D1 database
24
24
wrangler d1 backup Interact with D1 Backups
25
25
wrangler d1 execute <database> Executed command or SQL file
26
+ wrangler d1 time-travel Use Time Travel to restore, fork or copy a database at a specific point-in-time.
26
27
wrangler d1 migrations Interact with D1 Migrations
27
28
28
29
Flags:
@@ -64,6 +65,7 @@ describe("d1", () => {
64
65
wrangler d1 delete <name> Delete D1 database
65
66
wrangler d1 backup Interact with D1 Backups
66
67
wrangler d1 execute <database> Executed command or SQL file
68
+ wrangler d1 time-travel Use Time Travel to restore, fork or copy a database at a specific point-in-time.
67
69
wrangler d1 migrations Interact with D1 Migrations
68
70
69
71
Flags:
@@ -81,4 +83,70 @@ describe("d1", () => {
81
83
--------------------"
82
84
` ) ;
83
85
} ) ;
86
+
87
+ it ( "should show help when the migrations command is passed" , async ( ) => {
88
+ await expect ( ( ) => runWrangler ( "d1 migrations" ) ) . rejects . toThrow (
89
+ "Not enough non-option arguments: got 0, need at least 1"
90
+ ) ;
91
+
92
+ expect ( std . err ) . toMatchInlineSnapshot ( `
93
+ "[31mX [41;31m[[41;97mERROR[41;31m][0m [1mNot enough non-option arguments: got 0, need at least 1[0m
94
+
95
+ "
96
+ ` ) ;
97
+ expect ( std . out ) . toMatchInlineSnapshot ( `
98
+ "
99
+ wrangler d1 migrations
100
+
101
+ Interact with D1 Migrations
102
+
103
+ Commands:
104
+ wrangler d1 migrations list <database> List your D1 migrations
105
+ wrangler d1 migrations create <database> <message> Create a new Migration
106
+ wrangler d1 migrations apply <database> Apply D1 Migrations
107
+
108
+ Flags:
109
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
110
+ -c, --config Path to .toml configuration file [string]
111
+ -e, --env Environment to use for operations and .env files [string]
112
+ -h, --help Show help [boolean]
113
+ -v, --version Show version number [boolean]
114
+
115
+ --------------------
116
+ 🚧 D1 is currently in open alpha and is not recommended for production data and traffic
117
+ 🚧 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose
118
+ 🚧 To request features, visit https://community.cloudflare.com/c/developers/d1
119
+ 🚧 To give feedback, visit https://discord.gg/cloudflaredev
120
+ --------------------"
121
+ ` ) ;
122
+ } ) ;
123
+
124
+ it ( "should show help when the time travel command is passed" , async ( ) => {
125
+ await expect ( ( ) => runWrangler ( "d1 time-travel" ) ) . rejects . toThrow (
126
+ "Not enough non-option arguments: got 0, need at least 1"
127
+ ) ;
128
+
129
+ expect ( std . err ) . toMatchInlineSnapshot ( `
130
+ "[31mX [41;31m[[41;97mERROR[41;31m][0m [1mNot enough non-option arguments: got 0, need at least 1[0m
131
+
132
+ "
133
+ ` ) ;
134
+ expect ( std . out ) . toMatchInlineSnapshot ( `
135
+ "
136
+ wrangler d1 time-travel
137
+
138
+ Use Time Travel to restore, fork or copy a database at a specific point-in-time.
139
+
140
+ Commands:
141
+ wrangler d1 time-travel info <database> Retrieve information about a database at a specific point-in-time using Time Travel.
142
+ wrangler d1 time-travel restore <database> Restore a database back to a specific point-in-time.
143
+
144
+ Flags:
145
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
146
+ -c, --config Path to .toml configuration file [string]
147
+ -e, --env Environment to use for operations and .env files [string]
148
+ -h, --help Show help [boolean]
149
+ -v, --version Show version number [boolean]"
150
+ ` ) ;
151
+ } ) ;
84
152
} ) ;
0 commit comments