createOracleDriver creates and opens an Oracle driver connection
(ctx context.Context, host, port, username string)
| 31 | |
| 32 | // createOracleDriver creates and opens an Oracle driver connection |
| 33 | func createOracleDriver(ctx context.Context, host, port, username string) (db.Driver, error) { |
| 34 | driver := &oracledb.Driver{} |
| 35 | config := db.ConnectionConfig{ |
| 36 | DataSource: &storepb.DataSource{ |
| 37 | Type: storepb.DataSourceType_ADMIN, |
| 38 | Username: username, |
| 39 | Host: host, |
| 40 | Port: port, |
| 41 | Database: "", |
| 42 | ServiceName: "FREEPDB1", |
| 43 | }, |
| 44 | Password: "test123", // Use same password as container for test simplicity |
| 45 | ConnectionContext: db.ConnectionContext{ |
| 46 | EngineVersion: "23.0", |
| 47 | DatabaseName: strings.ToUpper(username), |
| 48 | }, |
| 49 | } |
| 50 | return driver.Open(ctx, storepb.Engine_ORACLE, config) |
| 51 | } |
| 52 | |
| 53 | // executeStatements executes multiple SQL statements, handling both regular DDL and PL/SQL blocks |
| 54 | func executeStatements(ctx context.Context, driver db.Driver, statements string) error { |
no test coverage detected