Skip to content

Commit 72640f4

Browse files
first commit
0 parents  commit 72640f4

File tree

11 files changed

+1756
-0
lines changed

11 files changed

+1756
-0
lines changed

.idea/ vault-plugin-database-clickhouse.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Determine this makefile's path.
2+
# Be sure to place this BEFORE `include` directives, if any.
3+
4+
GO_VERSION_MIN=1.17.11
5+
GO_CMD?=go
6+
7+
default: build
8+
9+
build:
10+
$(GO_CMD) build -o bin/clickhouse-database-plugin .

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# vault-plugin-database-clickhouse

clickhouse-database-plugin/main.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package main
2+
3+
import (
4+
clickhouse "_vault-plugin-database-clickhouse"
5+
"log"
6+
"os"
7+
8+
dbplugin "github.com/hashicorp/vault/sdk/database/dbplugin/v5"
9+
)
10+
11+
func main() {
12+
err := Run()
13+
if err != nil {
14+
log.Println(err)
15+
os.Exit(1)
16+
}
17+
}
18+
19+
// Run instantiates a Clickhouse object, and runs the RPC server for the plugin
20+
func Run() error {
21+
dbType, err := clickhouse.New()
22+
if err != nil {
23+
return err
24+
}
25+
26+
dbplugin.Serve(dbType.(dbplugin.Database))
27+
28+
return nil
29+
}

0 commit comments

Comments
 (0)