PostgreSQLClientKit querying database

Is there a short way to prepare the statements and execute them, if you are trying to run multiple queries and you are not concerned with the results that are generated by those statements.

Forexample I want to execute these two statements, is there any short way to write these two statements and execute them.

do{
        let load_age_statement = try connection.prepareStatement(text: "Load 'age';")
        let set_path_statement = try connection.prepareStatement(text: "SET search_path = ag_catalog, '$user', public;")
    
        var cursor = try load_age_statement.execute()
        load_age_statement.close()
        cursor  = try set_path_statement.execute()
        
}catch{
        print(error)
}


Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept