Skip to content

Commit 1bd30c9

Browse files
committed
add README
1 parent 263e2c0 commit 1bd30c9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SQL Splitter
2+
3+
Split the output of SSMS-scripted objects (even the whole database) into
4+
individual files.
5+
6+
## Usage:
7+
```
8+
Usage: sql-splitter [OPTIONS] [IN_FILE]
9+
10+
Arguments:
11+
[IN_FILE] File(s) to process
12+
13+
Options:
14+
-d, --out-dir <OUT_DIR> Output directory to create files [default: .]
15+
-n, --only_names Exclude schema-name from filenames
16+
-v, --verbose Verbose output
17+
-w, --windows-1252 specify that input files are using windows-1252 encoding instead of UTF-8
18+
-h, --help Print help
19+
-V, --version Print version
20+
```
21+
22+
If `<IN_FILE>` is not specified, it will be read from STDIN (useful if you told
23+
SSMS to copy its output to the clipboard).
24+
25+
If `<OUT_DIR>` is not specified, it the files will be created in the current
26+
directory.
27+
28+
The output files will be named according to the following rules:
29+
`<ObjectType>/[<Schema>.]<ObjectName>.sql`
30+
- `<Schema>` is only populated for objects where database-schema is relevant.
31+
- Supplying the `--only_names` option will exclude schema-name from filenames.
32+
33+
If running this script gives an error relating to files not being UTF-8
34+
encoded, you can run it with the `--windows-1252` option.

0 commit comments

Comments
 (0)