FastDb
class · namespace z3n7 · source Db/FastDb.cs
public class FastDb
SQLite access through ZennoPoster's built-in ODBC query runner, without opening own connections.
Constructors
FastDb
public FastDb(IZennoPosterProjectModel project, string dbName = null, bool log = false)
Uses the file {project.Path}{dbName}.sql.
| Parameter | Description |
|---|---|
dbName |
File name without extension; default is the dbName variable, or db. |
log |
Write queries and SELECT answers to the log. |
Methods
dbList
public List<string> dbList(string query)
Executes a query and returns its rows.
dbString
public string dbString(string query)
Executes a query.
Returns: Rows joined by line breaks, columns by |.
ExportToCsv
public void ExportToCsv(string tableName, string fileName)
Writes the whole table to {project.Path}{fileName} as CSV with a header row (UTF-8).
public void ExportToCsv(string tableName, string fileName, string columns = "*")
Writes the selected columns to {project.Path}{fileName} as CSV, UTF-8 with BOM so that Excel opens it correctly.
| Parameter | Description |
|---|---|
columns |
* for all columns, or a comma-separated list that is also used as the header. |