diff --git a/.gitignore b/.gitignore index 8028b14..5a0d06a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -relay-lite -relay-full -*.sqlite +relay *.env diff --git a/Makefile b/Makefile index 0d0813d..6bd7e89 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,2 @@ -relay-lite: $(shell find . -name "*.go") - go build -ldflags="-s -w" -tags lite -o ./relay-lite - -relay-full: $(shell find . -name "*.go") - go build -ldflags="-s -w" -o ./relay-full +relay: $(shell find . -name "*.go") + go build -ldflags="-s -w" -o ./relay diff --git a/sqlite.go b/sqlite.go deleted file mode 100644 index 636cb1c..0000000 --- a/sqlite.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build lite - -package main - -import ( - "github.com/jmoiron/sqlx" - _ "github.com/mattn/go-sqlite3" -) - -func initDB() (*sqlx.DB, error) { - db, err := sqlx.Connect("sqlite3", s.SQLiteDatabase) - if err != nil { - return nil, err - } - - _, err = db.Exec(` -CREATE TABLE event ( - id text NOT NULL, - pubkey text NOT NULL, - created_at integer NOT NULL, - kind integer NOT NULL, - tags text NOT NULL, - content text NOT NULL, - sig text NOT NULL -); - -CREATE UNIQUE INDEX ididx ON event (id); -CREATE INDEX pubkeytimeidx ON event (pubkey, created_at); - `) - return db, nil -} - -const relatedEventsCondition = `tags LIKE '%' || ? || '%'`