remove sqlite support.

This commit is contained in:
fiatjaf
2021-11-08 14:52:12 -03:00
parent 405dfd3425
commit c1c3d29723
3 changed files with 3 additions and 41 deletions

4
.gitignore vendored
View File

@@ -1,4 +1,2 @@
relay-lite
relay-full
*.sqlite
relay
*.env

View File

@@ -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

View File

@@ -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 '%' || ? || '%'`