diff --git a/app.go b/app.go index 74a8598..cbff814 100644 --- a/app.go +++ b/app.go @@ -24,8 +24,6 @@ import ( "syscall" "time" - _ "github.com/go-sql-driver/mysql" - "github.com/gorilla/mux" "github.com/gorilla/schema" "github.com/gorilla/sessions" diff --git a/database-lib.go b/database-lib.go new file mode 100644 index 0000000..58beb05 --- /dev/null +++ b/database-lib.go @@ -0,0 +1,20 @@ +// +build wflib + +/* + * Copyright © 2019 A Bunch Tell LLC. + * + * This file is part of WriteFreely. + * + * WriteFreely is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, included + * in the LICENSE file in this source code package. + */ + +// This file contains dummy database funcs for when writefreely is used as a +// library. + +package writefreely + +func (db *datastore) isDuplicateKeyErr(err error) bool { + return false +} diff --git a/database-no-sqlite.go b/database-no-sqlite.go index 10db7d5..a3d50fc 100644 --- a/database-no-sqlite.go +++ b/database-no-sqlite.go @@ -1,4 +1,4 @@ -// +build !sqlite +// +build !sqlite,!wflib /* * Copyright © 2019 A Bunch Tell LLC. diff --git a/database-sqlite.go b/database-sqlite.go index 5fa3f6c..3741169 100644 --- a/database-sqlite.go +++ b/database-sqlite.go @@ -1,4 +1,4 @@ -// +build sqlite +// +build sqlite,!wflib /* * Copyright © 2019 A Bunch Tell LLC.