7 google-cloud-bigtable-tool,
11 pname = "cbtemulator";
14 src = fetchFromGitHub {
16 repo = "google-cloud-go";
17 rev = "bigtable/v${version}";
18 hash = "sha256-prDwy65pxWDrIJOURe2JHo4sY4yP8IE1Rp1pLUL/IAA=";
21 # There's a go.{mod,sum} in the root and in the "bigtable" subdir.
22 # We only ever use things in that subdir.
23 sourceRoot = "${src.name}/bigtable";
26 vendorHash = "sha256-EDfxT56LKEu/iXPp5RJXb4UIRV2jFFNxh3ZINPbwKTM=";
28 subPackages = [ "cmd/emulator" ];
31 mv $out/bin/emulator $out/bin/cbtemulator
35 # Sets up a table and family, then inserts, and ensures it gets back the value.
37 runCommand "cbtemulator-smoketest"
39 nativeBuildInputs = [ google-cloud-bigtable-tool ];
43 ${lib.getExe cbtemulator} &
52 export BIGTABLE_EMULATOR_HOST=localhost:9000
54 cbt -instance instance-1 -project project-1 createtable table-1
55 cbt -instance instance-1 -project project-1 createfamily table-1 cf1
56 cbt -instance instance-1 -project project-1 ls table-1
57 cbt -instance instance-1 -project project-1 set table-1 key1 cf1:c1=value1
59 cbt -instance instance-1 -project project-1 read table-1 | grep -q value1
66 description = "In-memory Google Cloud Bigtable server";
67 homepage = "https://github.com/googleapis/google-cloud-go/blob/bigtable/v${version}/bigtable/cmd/emulator/cbtemulator.go";
68 license = licenses.asl20;
69 maintainers = [ maintainers.flokli ];
70 mainProgram = "cbtemulator";
71 platforms = platforms.all;