mirror of
https://github.com/fiatjaf/khatru.git
synced 2026-06-02 16:53:07 +02:00
remove sqlite support.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,2 @@
|
||||
relay-lite
|
||||
relay-full
|
||||
*.sqlite
|
||||
relay
|
||||
*.env
|
||||
|
||||
7
Makefile
7
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
|
||||
|
||||
33
sqlite.go
33
sqlite.go
@@ -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 '%' || ? || '%'`
|
||||
Reference in New Issue
Block a user