Skip to content

Accessing SQLite from Javascript #61

Closed Answered by NecroticNanite
NecroticNanite asked this question in Q&A
Discussion options

You must be logged in to vote

Figure that this works, unless there's a simpler way? Wanted to pool the lists (My own implementation, lists are cleared on release) since this might be called a lot and reducing allocations can't hurt, especially when there's a lot of string allocations already.

private void SimpleStringQuery(string query, List<List<string>> results)
{
    var stmt = SQLite3.Prepare2 (m_connection.Handle, query);
    try
    {
        while (SQLite3.Step(stmt) == SQLite3.Result.Row)
        {
            List<string> row = ListPool<string>.Get();
            for (int i = 0; i < SQLite3.ColumnCount(stmt); i++)
            {
                row.Add(SQLite3.ColumnString(stmt, i));
            }
            r…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@NecroticNanite
Comment options

@gilzoide
Comment options

@NecroticNanite
Comment options

@NecroticNanite
Comment options

@gilzoide
Comment options

Comment options

You must be logged in to vote
3 replies
@gilzoide
Comment options

@NecroticNanite
Comment options

Answer selected by NecroticNanite
@gilzoide
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
webgl Issue occurs on WebGL platform
2 participants