PageRenderTime 27ms queryTime 58ms sortTime 0ms getByIdsTime 5ms findMatchingLines 4ms

19+ results for 'lang:go SetMaxOpenConns sqlite' (27 ms)

Not the results you expected?
db_alias.go https://gitlab.com/kumarsiva07/beefer | Go | 292 lines
                    
30	DR_MySQL                      // mysql
                    
31	DR_Sqlite                     // sqlite
                    
32	DR_Oracle                     // oracle
                    
57		"postgres": DR_Postgres,
                    
58		"sqlite3":  DR_Sqlite,
                    
59	}
                    
61		DR_MySQL:    newdbBaseMysql(),
                    
62		DR_Sqlite:   newdbBaseSqlite(),
                    
63		DR_Oracle:   newdbBaseMysql(),
                    
149
                    
150	case DR_Sqlite:
                    
151		al.TZ = time.UTC
                    
223		case 1:
                    
224			SetMaxOpenConns(al.Name, v)
                    
225		}
                    
                
engine.go https://github.com/housecream/server.git | Go | 1563 lines
                    
122// QuoteStr Engine's database use which character as quote.
                    
123// mysql, sqlite use ` and postgres use "
                    
124func (engine *Engine) QuoteStr() string {
                    
188
                    
189// SetMaxOpenConns is only available for go 1.2+
                    
190func (engine *Engine) SetMaxOpenConns(conns int) {
                    
190func (engine *Engine) SetMaxOpenConns(conns int) {
                    
191	engine.db.SetMaxOpenConns(conns)
                    
192}
                    
                
db_alias.go https://gitlab.com/kumarsiva07/beego | Go | 298 lines
                    
31	DRMySQL                      // mysql
                    
32	DRSqlite                     // sqlite
                    
33	DROracle                     // oracle
                    
59		"postgres": DRPostgres,
                    
60		"sqlite3":  DRSqlite,
                    
61		"tidb":     DRTiDB,
                    
65		DRMySQL:    newdbBaseMysql(),
                    
66		DRSqlite:   newdbBaseSqlite(),
                    
67		DROracle:   newdbBaseOracle(),
                    
154
                    
155	case DRSqlite, DROracle:
                    
156		al.TZ = time.UTC
                    
229		case 1:
                    
230			SetMaxOpenConns(al.Name, v)
                    
231		}
                    
                
sqlite3_go18_test.go git://github.com/mattn/go-sqlite3.git | Go | 503 lines
                    
7
                    
8package sqlite3
                    
9
                    
24	defer os.Remove(tempFilename)
                    
25	db, err := sql.Open("sqlite3", tempFilename)
                    
26	if err != nil {
                    
117
                    
118	db, err := sql.Open("sqlite3", srcTempFilename)
                    
119	if err != nil {
                    
142
                    
143	db, err := sql.Open("sqlite3", srcTempFilename)
                    
144	if err != nil {
                    
165	// expect query above take ~ same time as setup above
                    
166	// This is racy: the context must be valid so sql/db.ExecContext calls the sqlite3 driver.
                    
167	// It starts the query, the context expires, then calls sqlite3_interrupt
                    
                
db_alias.go https://gitlab.com/e0/harbor | Go | 297 lines
                    
31	DRMySQL                      // mysql
                    
32	DRSqlite                     // sqlite
                    
33	DROracle                     // oracle
                    
59		"postgres": DRPostgres,
                    
60		"sqlite3":  DRSqlite,
                    
61		"tidb":     DRTiDB,
                    
64		DRMySQL:    newdbBaseMysql(),
                    
65		DRSqlite:   newdbBaseSqlite(),
                    
66		DROracle:   newdbBaseOracle(),
                    
153
                    
154	case DRSqlite:
                    
155		al.TZ = time.UTC
                    
228		case 1:
                    
229			SetMaxOpenConns(al.Name, v)
                    
230		}
                    
                
connection.go https://gitlab.com/mikattack/linksink | Go | 107 lines
                    
6
                    
7	_ "github.com/mattn/go-sqlite3"
                    
8	"github.com/jmoiron/sqlx"
                    
20/* 
                    
21 * Initializes a SQLite database
                    
22 */ 
                    
33	// Open database file
                    
34	db, err := sqlx.Open("sqlite3", path)
                    
35	if err != nil {
                    
52	db.SetMaxIdleConns(DEFAULT_IDLE_CONNECTIONS)
                    
53	db.SetMaxOpenConns(DEFAULT_OPEN_CONNECTIONS)
                    
54
                    
                
conn.go https://gitlab.com/admin-github-cloud/dex | Go | 110 lines
                    
35	// The maximum number of open connections to the database. The default is 0 (unlimited).
                    
36	// For more details see: http://golang.org/pkg/database/sql/#DB.SetMaxOpenConns
                    
37	MaxOpenConnections int
                    
58		db.SetMaxIdleConns(cfg.MaxIdleConnections)
                    
59		db.SetMaxOpenConns(cfg.MaxOpenConnections)
                    
60		dialect = gorp.PostgresDialect{}
                    
60		dialect = gorp.PostgresDialect{}
                    
61	case "sqlite3":
                    
62		db, err = sql.Open("sqlite3", u.Host)
                    
66		if u.Host == ":memory:" {
                    
67			// NOTE(ericchiang): sqlite3 coordinates concurrent clients through file locks.
                    
68			// In memory databases do not support concurrent calls. Limit the number of
                    
70			//
                    
71			// See: https://www.sqlite.org/faq.html#q5
                    
72			db.SetMaxOpenConns(1)
                    
                
mauth.go https://gitlab.com/mikattack/mauth | Go | 96 lines
                    
7	"github.com/spf13/cobra"
                    
8	_ "github.com/mattn/go-sqlite3"
                    
9	"github.com/jmoiron/sqlx"
                    
15const (
                    
16	sqlite_default_file string = "./mauth.db"
                    
17	sqlite_default_idle_connections int = 10
                    
17	sqlite_default_idle_connections int = 10
                    
18	sqlite_default_open_connections int = 10
                    
19)
                    
55	//       actually run. Until then, the value is the default.
                    
56	MauthCmd.PersistentFlags().StringVar(&dbpath, "db", sqlite_default_file, "Path to SQLite database file")
                    
57}
                    
92	pool.SetMaxIdleConns(sqlite_default_idle_connections)
                    
93	pool.SetMaxOpenConns(sqlite_default_open_connections)
                    
94
                    
                
sqlite.go https://bitbucket.org/depechebot/pyjamabot.git | Go | 289 lines
                    
1package sqlite
                    
2
                    
30	// slowing this model down cause of this bug:
                    
31	// https://github.com/mattn/go-sqlite3/issues/274
                    
32	m.db.SetMaxOpenConns(1)
                    
                
sql.go https://gitlab.com/kidaa/kythe | Go | 295 lines
                    
35
                    
36	_ "github.com/mattn/go-sqlite3" // register the "sqlite3" driver
                    
37)
                    
38
                    
39// SQLite3 is the standard database/sql driver name for sqlite3.
                    
40const SQLite3 = "sqlite3"
                    
42func init() {
                    
43	gsutil.Register(SQLite3, func(spec string) (graphstore.Service, error) { return Open(SQLite3, spec) })
                    
44}
                    
141	}
                    
142	db.SetMaxOpenConns(1) // TODO(schroederc): Without this, concurrent writers will get a "database
                    
143	//                                         is locked" error from sqlite3.  Unfortunately, writing
                    
                
sqlite3_go113_test.go git://github.com/mattn/go-sqlite3.git | Go | 119 lines
                    
7
                    
8package sqlite3
                    
9
                    
22
                    
23	db, err := sql.Open("sqlite3", srcTempFilename)
                    
24	if err != nil {
                    
27
                    
28	db.SetMaxOpenConns(10)
                    
29	db.SetMaxIdleConns(5)
                    
52				}
                    
53				// checks that conn.Raw can be used to get *SQLiteConn
                    
54				if _, ok = driverConn.(*SQLiteConn); !ok {
                    
54				if _, ok = driverConn.(*SQLiteConn); !ok {
                    
55					t.Fatalf("conn.Raw() driverConn type=%T, expected *SQLiteConn", driverConn)
                    
56				}
                    
                
sqlite.go https://bitbucket.org/asardak/atm-store.git | Go | 143 lines
                    
16
                    
17func (repo *SqliteRepo) Init() bool {
                    
18
                    
19	var err error
                    
20	if repo.db, err = sqlx.Connect("sqlite3", "/tmp/foo.db?mode=memory&cache=shared"); err != nil {
                    
21		panic(err)
                    
22	}
                    
23	repo.db.SetMaxOpenConns(8)
                    
24	repo.db.SetMaxIdleConns(8)
                    
37
                    
38	log.Printf("Seeding data to Sqlite")
                    
39	sqlStmt := `
                    
141func init() {
                    
142	registerRepo("sqlite", &SqliteRepo{})
                    
143}
                    
                
example_test.go https://bitbucket.org/foursource/dbr-internal.git | Go | 162 lines
                    
8func ExampleOpen() {
                    
9	// create a connection (e.g. "postgres", "mysql", or "sqlite3")
                    
10	conn, _ := Open("postgres", "...", nil)
                    
10	conn, _ := Open("postgres", "...", nil)
                    
11	conn.SetMaxOpenConns(10)
                    
12
                    
                
create.go https://gitlab.com/IIC2173-2015-2-Grupo2/news-api | Go | 37 lines
                    
15	// db, err := gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local")
                    
16	// db, err := gorm.Open("sqlite3", "/tmp/gorm.db")
                    
17
                    
33	db.DB().SetMaxIdleConns(10)
                    
34	db.DB().SetMaxOpenConns(100)
                    
35
                    
                
sql_store.go https://gitlab.com/Realtyka/platform | Go | 761 lines
                    
172	db.SetMaxIdleConns(maxIdle)
                    
173	db.SetMaxOpenConns(maxOpen)
                    
174
                    
176
                    
177	if driver == "sqlite3" {
                    
178		dbmap = &gorp.DbMap{Db: db, TypeConverter: mattermConverter{}, Dialect: gorp.SqliteDialect{}}
                    
                
main.go https://gitlab.com/AlekseyLobanov/gokeystat | Go | 305 lines
                    
14
                    
15	_ "github.com/mattn/go-sqlite3"
                    
16)
                    
247	// Opening database
                    
248	db, err := sql.Open("sqlite3", DATABASE_NAME)
                    
249	if err != nil {
                    
252	db.SetMaxIdleConns(5)
                    
253	db.SetMaxOpenConns(5)
                    
254	defer db.Close()
                    
                
engine.go https://gitlab.com/lust4life/grafana | Go | 1446 lines
                    
90// Engine's database use which charactor as quote.
                    
91// mysql, sqlite use ` and postgres use "
                    
92func (engine *Engine) QuoteStr() string {
                    
116
                    
117// SetMaxOpenConns is only available for go 1.2+
                    
118func (engine *Engine) SetMaxOpenConns(conns int) {
                    
118func (engine *Engine) SetMaxOpenConns(conns int) {
                    
119	engine.db.SetMaxOpenConns(conns)
                    
120}
                    
123func (engine *Engine) SetMaxConns(conns int) {
                    
124	engine.SetMaxOpenConns(conns)
                    
125}
                    
                
sqlstore.go https://github.com/housecream/server.git | Go | 212 lines
                    
22	_ "github.com/lib/pq"
                    
23	_ "github.com/mattn/go-sqlite3"
                    
24)
                    
43
                    
44	UseSQLite3 bool
                    
45	sqlog      log.Logger = log.New("sqlstore")
                    
143		cnnstr = fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s sslcert=%s sslkey=%s sslrootcert=%s", DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode, DbCfg.ClientCertPath, DbCfg.ClientKeyPath, DbCfg.CaCertPath)
                    
144	case "sqlite3":
                    
145		if !filepath.IsAbs(DbCfg.Path) {
                    
158	} else {
                    
159		engine.SetMaxOpenConns(DbCfg.MaxOpenConn)
                    
160		engine.SetMaxIdleConns(DbCfg.MaxIdleConn)
                    
199
                    
200	if DbCfg.Type == "sqlite3" {
                    
201		UseSQLite3 = true
                    
                
init.go https://gitlab.com/hippora/hippoblog | Go | 22 lines
                    
2import (
                    
3	_ "github.com/mattn/go-sqlite3"
                    
4	"github.com/go-xorm/xorm"
                    
11	var err error
                    
12	db,err = xorm.NewEngine("sqlite3","test.db")
                    
13	if err != nil {
                    
16	//engine.SetMaxIdleConns(10)
                    
17	//engine.SetMaxOpenConns(10)
                    
18	db.ShowSQL(true)
                    
                
 

Source

Language