stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.73k stars 1.57k forks source link

Raw query Statement enhancement request #837

Closed tes237 closed 3 years ago

tes237 commented 6 years ago

Firstly, Thank you for making good library

Currently, i can get row with index while using raw query. But i want to get the thing with Expression like row[VERSION]. Example :

            let sqlStr = "SELECT \(VERSION!) FROM  \(TABLE_SERVICE_VERSION!) "

            let stmt = try mDb!.prepare(sqlStr)

            for row in stmt
            {
                print("\(row[0])")    -----enhancement----> print("\(row[VERSION])") 
            }

Such thing is available in Android java. Following is Android code and search_cursor is kind of stmt in your library.

String ver = search_cursor.getString(search_cursor.getColumnIndex(VERSION));

Thanks in advance

jberkel commented 3 years ago

please use stackoverflow