1
0
forked from MTSR/mapserver
This commit is contained in:
NatureFreshMilk 2019-01-25 11:18:35 +01:00
parent 75bf921b54
commit bd2f794af8
4 changed files with 5 additions and 8 deletions

View File

@ -17,7 +17,6 @@ and o.posx <= ? and o.posy <= ? and o.posz <= ?
order by o.id order by o.id
` `
func (db *Sqlite3Accessor) GetMapData(q SearchQuery) ([]*MapObject, error) { func (db *Sqlite3Accessor) GetMapData(q SearchQuery) ([]*MapObject, error) {
rows, err := db.db.Query(getMapDataPosQuery, rows, err := db.db.Query(getMapDataPosQuery,
q.Type, q.Type,
@ -43,7 +42,6 @@ func (db *Sqlite3Accessor) GetMapData(q SearchQuery) ([]*MapObject, error) {
var posx, posy, posz int var posx, posy, posz int
var key, value string var key, value string
err = rows.Scan(&id, &Type, &mtime, err = rows.Scan(&id, &Type, &mtime,
&x, &y, &z, &posx, &posy, &posz, &x, &y, &z, &posx, &posy, &posz,
&key, &value, &key, &value,

View File

@ -5,7 +5,6 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
) )
func NewSqliteAccessor(filename string) (*Sqlite3Accessor, error) { func NewSqliteAccessor(filename string) (*Sqlite3Accessor, error) {
//TODO: flag/config for unsafe db access //TODO: flag/config for unsafe db access
db, err := sql.Open("sqlite3", filename+"?_timeout=500&_journal_mode=MEMORY&_synchronous=OFF") db, err := sql.Open("sqlite3", filename+"?_timeout=500&_journal_mode=MEMORY&_synchronous=OFF")

View File

@ -1,10 +1,10 @@
package mapobjectdb package mapobjectdb
import ( import (
"fmt"
"io/ioutil" "io/ioutil"
"mapserver/coords" "mapserver/coords"
"os" "os"
"fmt"
"testing" "testing"
) )