                 #console.log("query #{@_table}: -- got result of doing query", resp)
                 if first
                     first = false
-                    if err
+                    if not resp.query[@_table]?
+                        console.warn("query on #{@_table} returned undefined")
+                        cb?("got not data")
+                    else if err
                         console.warn("query #{@_table}: _run: first error ", err)
                         cb?(err)
                     else


    _update_change: (change) =>
        #console.log("_update_change", change)
        changed_keys = []
        conflict = false
        if change.new_val?

    # initialization, and also if we disconnect and reconnect.
    _update_all: (v) =>
        #console.log("_update_all(#{@_table})", v)
        if not v?
            console.warn("_update_all(#{@_table}) called with v=undefined")
            return

        # Restructure the array of records in v as a mapping from the primary key
        # to the corresponding record.
