The `db_postgres` returns queried values, but not the column names.
    
    
    echo conn.get_all_rows(sql("select name, age from test_users"))
    # ==> @[@["Jim", "30"]]
    
    
    Run

Is there a way to get also the column names for the query? The `@["name", 
"age"]`?

Full example:
    
    
    import postgres, db_postgres, strutils, sequtils
    
    let conn = open("localhost:5432", "postgres", "", "nim_test")
    
    let batch = """
      drop table if exists test_users;
      
      create table test_users(
        name varchar(100) not null,
        age  integer      not null
      );
      
      insert into test_users (name, age) values ('Jim', 30)
    """
    for part in batch.split(";"): conn.exec(sql(part))
    
    echo conn.get_all_rows(sql("select name, age from test_users"))
    # ==> @[@["Jim", "30"]]
    
    
    Run

Reply via email to