mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
Microsoft SQL Server driver and prep
This commit is contained in:
parent
e6335dd58c
commit
deb579d8ad
63 changed files with 73767 additions and 13 deletions
51
edition/storage/storage_test.go
Normal file
51
edition/storage/storage_test.go
Normal file
|
@ -0,0 +1,51 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
package storage
|
||||
|
||||
// go test -timeout 30s github.com/documize/community/edition/storage -v
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/documize/community/core/env"
|
||||
"github.com/documize/community/domain/store"
|
||||
)
|
||||
|
||||
func TestSQLServerProviderDatabaseName(t *testing.T) {
|
||||
r := env.Runtime{}
|
||||
s := store.Store{}
|
||||
r.Flags.DBType = "sqlserver"
|
||||
r.Flags.DBConn = "sqlserver://username:password@host:port?database=Test1Documize"
|
||||
|
||||
SetSQLServerProvider(&r, &s)
|
||||
|
||||
if r.StoreProvider.DatabaseName() != "Test1Documize" {
|
||||
t.Errorf("expected %s got %s", "Test1Documize", r.StoreProvider.DatabaseName())
|
||||
}
|
||||
|
||||
t.Log(r.StoreProvider.MakeConnectionString())
|
||||
}
|
||||
|
||||
func TestSQLServerProviderDatabaseNameWithParams(t *testing.T) {
|
||||
r := env.Runtime{}
|
||||
s := store.Store{}
|
||||
r.Flags.DBType = "sqlserver"
|
||||
r.Flags.DBConn = "sqlserver://username:password@host:port?database=Test2Documize&some=param"
|
||||
|
||||
SetSQLServerProvider(&r, &s)
|
||||
|
||||
if r.StoreProvider.DatabaseName() != "Test2Documize" {
|
||||
t.Errorf("expected %s got %s", "Test2Documize", r.StoreProvider.DatabaseName())
|
||||
}
|
||||
|
||||
t.Log(r.StoreProvider.MakeConnectionString())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue