Compare commits

..

No commits in common. "main" and "v4" have entirely different histories.
main ... v4

2 changed files with 3 additions and 14 deletions

View file

@ -1,11 +0,0 @@
# Usage
pgsplit takes a PostgreSQL dump with multiple databases through STDIN and extracts them to the current directory, named with the database name and an .sql extension.
`pgsplit -list` prints the database names contained in the SQL dump.
`pgsplit` extracts all databases.
`pgsplit -include-all -except foo -except bar` extracts all databases except for foo and bar.
`pgsplit -exclude-all -except foo -except bar` extracts only databases foo and bar.

View file

@ -9,7 +9,7 @@ import (
"slices"
)
const VERSION = "v5"
const VERSION = "v4"
const MAXLINE = 1048576
type Db struct {
@ -68,11 +68,11 @@ func main() {
dbName := dbMatch[1]
db = NewDb(dbName)
if (flagIncludeAll && slices.Contains(flagExcept, dbName)) || (flagExcludeAll && !slices.Contains(flagExcept, dbName)) {
fmt.Printf("Skipping %s\n", dbName)
fmt.Printf("Skipping %s\n", dbName)
continue
}
fmt.Printf("Extracting %s\n", db.Name)
fmt.Printf("Database %s\n", db.Name)
if flagList {
continue
}