-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] SQLite support #78
Comments
Hi, I was looking around myself it seems there is a keydb.NewSQLDB() where you can pass it a sqlite or mysql connection. Looking at TestSQLite in Hope that helped -S |
Unfortunately only go devs could do that :) Was hoping for something that doesn't require coding. But it is good to know that it's somehow possible. Thanks |
well yeah there is a little bit of coding, but updating the server_dev file to use keydb.NewSQLDB() instead of keydb.TempDB(), isn't much of a stretch. If you want to test it out here is a little diff. diff --git a/cmd/dev_server/main.go b/cmd/dev_server/main.go
index b4d11c7..e909434 100644
--- a/cmd/dev_server/main.go
+++ b/cmd/dev_server/main.go
@@ -7,6 +7,7 @@ import (
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
+ "database/sql"
"encoding/pem"
"expvar"
"flag"
@@ -16,6 +17,8 @@ import (
"os"
"time"
+ _ "github.com/mattn/go-sqlite3"
+
"github.com/pinterest/knox"
"github.com/pinterest/knox/log"
"github.com/pinterest/knox/server"
@@ -62,8 +65,14 @@ func main() {
errLogger.Fatal("Failed to make TLS key or cert: ", err)
}
- db := keydb.NewTempDB()
-
+ d, err := sql.Open("sqlite3", "foo.db")
+ if err != nil {
+ errLogger.Fatal(err)
+ }
+ db, err := keydb.NewSQLDB(d)
+ if err != nil {
+ errLogger.Fatal(err)
+ }
server.AddDefaultAccess(&knox.Access{
Type: knox.UserGroup,
ID: "security-team", |
Thanks @stuartskelton! From your code it indeed looks like a simple change. |
Mods: may I thus change this issue from a question to a feature request for SQLite support? A small, simple and dockerised secrets tool - which uses sqlite - would be a gamechanger in this area. Please consider it? Thanks! |
I see postgres is supported.
Is sqlite supported? Or any others?
The text was updated successfully, but these errors were encountered: