Skip to content

Commit

Permalink
Add support for nested tables
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Sep 12, 2023
1 parent 05529d1 commit 8d8eaa2
Show file tree
Hide file tree
Showing 17 changed files with 610 additions and 208 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
bin
dist/
*.sql
.nix-profile*
.nix-profile*
*.sh
.devenv
.pre-commit-config.yaml
12 changes: 9 additions & 3 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
var src = flag.String("src", "", "Source database DSN")
var dst = flag.String("dst", "", "Destination database DSN")
var fraction = flag.Float64("f", 0.05, "Fraction of rows to copy")
var verbose = flag.Bool("verbose", true, "Show more information during sync")
var verbose = flag.Bool("verbose", false, "Show more information during sync")
var ver = flag.Bool("v", false, "Release information")
var extraInclude arrayExtra
var extraExclude arrayExtra
Expand All @@ -45,11 +45,17 @@ func main() {
log.Fatal().Msg("Fraction must be between 0 and 1")
}

if *verbose {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
} else {
zerolog.SetGlobalLevel(zerolog.InfoLevel)
}

if len(extraInclude) > 0 {
log.Info().Str("include", extraInclude.String()).Msg("Forcibly including")
log.Info().Str("include", extraInclude.String()).Msg("Forcibly")
}
if len(extraExclude) > 0 {
log.Info().Str("exclude", extraExclude.String()).Msg("Forcibly ignoring")
log.Info().Str("exclude", extraExclude.String()).Msg("Forcibly")
}

s, err := subsetter.NewSync(*src, *dst, *fraction, extraInclude, extraExclude, *verbose)
Expand Down
46 changes: 46 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ pkgs, lib, rootDir, ... }:

{
# See https://devenv.sh/getting-started/ for more information

packages = with pkgs;
[
entr # Run arbitrary commands when files change
gitAndTools.gh # GitHub CLI
heroku # Heroku CLI
process-compose # Run multiple processes in a single terminal
golangci-lint # Linter for Go
postgresql_15 # PostgreSQL database
eclint # EditorConfig linter and fixer
gnumake # GNU Make
goreleaser # Go binary release tool
];

languages.javascript.enable = true;
languages.go.enable = true;
languages.go.package = pkgs.go_1_21;


pre-commit.hooks = {
shellcheck.enable = true;
nixpkgs-fmt.enable = true;
gofmt.enable = true;
shfmt.enable = true;
golangci-lint = {
enable = false;
pass_filenames = false;
name = "golangci-lint";
files = ".*";
entry = "bash -c 'cd $(${rootDir})/backend; ${pkgs.golangci-lint}/bin/golangci-lint run --fix'";
};
eclint = {
enable = true;
pass_filenames = false;
name = "eclint";
files = ".*";
entry = "${pkgs.eclint}/bin/eclint --fix";
};
};


}
232 changes: 221 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8d8eaa2

Please sign in to comment.