func compileStatements() error {
	statements = new(clientSideStatements)
	err := json.Unmarshal([]byte(jsonFile), statements)
	if err != nil {
		return err
	}
	statements.executor = &statementExecutor{}
	for _, stmt := range statements.Statements {
		stmt.regexp, err = regexp.Compile(stmt.Regex)
		if err != nil {
			return err
		}
		i := reflect.ValueOf(statements.executor).MethodByName(strings.TrimPrefix(stmt.MethodName, "statement")).Interface()
		if execContext, ok := i.(func(ctx context.Context, c *conn, query string, args []driver.NamedValue) (driver.Result, error)); ok {
			stmt.execContext = execContext
		}
		if queryContext, ok := i.(func(ctx context.Context, c *conn, query string, args []driver.NamedValue) (driver.Rows, error)); ok {
			stmt.queryContext = queryContext
		}
	}
	return nil
}
// compileStatements loads all client side statements from the json file and
// assigns the Go methods to the different statements that should be executed
// when on of the statements is executed on a connection.
compileStatements loads all client side statements from the json file and
assigns the Go methods to the different statements that should be executed
when on of the statements is executed on a connection.
// compileStatements loads all client side statements from the json file and // assigns the Go methods to the different statements that should be executed // when on of the statements is executed on a connection .
func compileStatements() error {
	statements = new(clientSideStatements)
	err := json.Unmarshal([]byte(jsonFile), statements)
	if err != nil {
		return err
	}
	statements.executor = &statementExecutor{}
	for _, stmt := range statements.Statements {
		stmt.regexp, err = regexp.Compile(stmt.Regex)
		if err != nil {
			return err
		}
		i := reflect.ValueOf(statements.executor).MethodByName(strings.TrimPrefix(stmt.MethodName, "statement")).Interface()
		if execContext, ok := i.(func(ctx context.Context, c *conn, query string, args []driver.NamedValue) (driver.Result, error)); ok {
			stmt.execContext = execContext
		}
		if queryContext, ok := i.(func(ctx context.Context, c *conn, query string, args []driver.NamedValue) (driver.Rows, error)); ok {
			stmt.queryContext = queryContext
		}
	}
	return nil
}
func compileStatements ( ) error { statements = new ( clientSideStatements ) err := json . Unmarshal ( [ ] byte ( jsonFile ) , statements ) if err != nil { return err } statements . executor = & statementExecutor { } for _ , stmt := range statements . Statements { stmt . regexp , err = regexp . Compile ( stmt . Regex ) if err != nil { return err } i := reflect . ValueOf ( statements . executor ) . MethodByName ( strings . TrimPrefix ( stmt . MethodName , " " ) ) . Interface ( ) if execContext , ok := i . ( func ( ctx context . Context , c * conn , query string , args [ ] driver . NamedValue ) ( driver . Result , error ) ) ; ok { stmt . execContext = execContext } if queryContext , ok := i . ( func ( ctx context . Context , c * conn , query string , args [ ] driver . NamedValue ) ( driver . Rows , error ) ) ; ok { stmt . queryContext = queryContext } } return nil }
compileStatements loads all client side statements from the json file and
assigns the Go methods to the different statements that should be executed
when on of the statements is executed on a connection.
compileStatements loads all client side statements from the json file and assigns the Go methods to the different statements that should be executed when on of the statements is executed on a connection .