- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for prepareContent (0.79 sec)
-
tests/connpool_test.go
"gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) type wrapperTx struct { *sql.Tx conn *wrapperConnPool } func (c *wrapperTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { c.conn.got = append(c.conn.got, query) return c.Tx.PrepareContext(ctx, query) } func (c *wrapperTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Tue Feb 06 02:54:40 UTC 2024 - 5.5K bytes - Viewed (0) -
prepare_stmt.go
// Reason why cannot lock conn.PrepareContext // suppose the maxopen is 1, g1 is creating record and g2 is querying record. // 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1. // 2. g2 select lock `conn.PrepareContext(ctx, query)`, now db.numOpen == db.maxOpen , wait for release. // 3. g1 tx exec insert, wait for unlock `conn.PrepareContext(ctx, query)` to finish tx and release.
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Thu Mar 28 08:47:39 UTC 2024 - 6.4K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/collect/MapsMemoryBenchmark.java
Map<Element, Element> map; CollectionBenchmarkSampleData elems; @Param({"0", "1", "100", "10000"}) int elements; @BeforeExperiment public void prepareContents() throws Exception { mapsImpl = mapEnums.get(implName); elems = new CollectionBenchmarkSampleData(elements); contents = Maps.newHashMap(); for (Element key : elems.getValuesInSet()) {
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Fri Dec 20 15:07:46 UTC 2019 - 3.4K bytes - Viewed (0) -
interfaces.go
} type ParamsFilter interface { ParamsFilter(ctx context.Context, sql string, params ...interface{}) (string, []interface{}) } // ConnPool db conns pool interface type ConnPool interface { PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Sat Aug 19 13:33:31 UTC 2023 - 2.2K bytes - Viewed (0) -
api/go1.8.txt
pkg database/sql/driver, type ConnBeginTx interface, BeginTx(context.Context, TxOptions) (Tx, error) pkg database/sql/driver, type ConnPrepareContext interface { PrepareContext } pkg database/sql/driver, type ConnPrepareContext interface, PrepareContext(context.Context, string) (Stmt, error) pkg database/sql/driver, type ExecerContext interface { ExecContext }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Dec 21 05:25:57 UTC 2016 - 16.3K bytes - Viewed (0) -
src/database/sql/ctxutil.go
"context" "database/sql/driver" "errors" ) func ctxDriverPrepare(ctx context.Context, ci driver.Conn, query string) (driver.Stmt, error) { if ciCtx, is := ci.(driver.ConnPrepareContext); is { return ciCtx.PrepareContext(ctx, query) } si, err := ci.Prepare(query) if err == nil { select { default: case <-ctx.Done(): si.Close() return nil, ctx.Err() } } return si, err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 02 12:57:37 UTC 2019 - 3.5K bytes - Viewed (0) -
src/database/sql/example_test.go
} log.Fatal(err) } if err := tx.Commit(); err != nil { log.Fatal(err) } } func ExampleStmt() { // In normal use, create one Stmt when your process starts. stmt, err := db.PrepareContext(ctx, "SELECT username FROM users WHERE id = ?") if err != nil { log.Fatal(err) } defer stmt.Close() // Then reuse it each time you need to issue the query. id := 43 var username string
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 28 14:05:09 UTC 2020 - 8.5K bytes - Viewed (0) -
src/database/sql/sql.go
// when the statement is no longer needed. // // Prepare uses [context.Background] internally; to specify the context, use // [DB.PrepareContext]. func (db *DB) Prepare(query string) (*Stmt, error) { return db.PrepareContext(context.Background(), query) } func (db *DB) prepare(ctx context.Context, query string, strategy connReuseStrategy) (*Stmt, error) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:16:53 UTC 2024 - 103.6K bytes - Viewed (0) -
src/database/sql/fakedb_test.go
} return stmt, nil } // hook to simulate broken connections var hookPrepareBadConn func() bool func (c *fakeConn) Prepare(query string) (driver.Stmt, error) { panic("use PrepareContext") } func (c *fakeConn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error) { c.numPrepare++ if c.db == nil { panic("nil c.db; conn = " + fmt.Sprintf("%#v", c)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 01 12:38:07 UTC 2024 - 30.3K bytes - Viewed (0) -
src/database/sql/driver/driver.go
} // ConnPrepareContext enhances the [Conn] interface with context. type ConnPrepareContext interface { // PrepareContext returns a prepared statement, bound to this connection. // context is for the preparation of the statement, // it must not store the context within the statement itself. PrepareContext(ctx context.Context, query string) (Stmt, error) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 23 09:04:12 UTC 2023 - 20.9K bytes - Viewed (0)