static byWhere(where, order) {
        return __awaiter(this, void 0, void 0, function* () {
            const rows = yield alasql_1.default.promise(`select id, creator, message, creationDate, likes
             from posts
             where ${where}
             ` + (order ? `order by ${order}` : ''));
            const result = [];
            for (const row of rows) {
                const creator = yield user_1.default.byId(row.creator);
                if (creator)
                    result.push(new Post(creator, row.message, row.creationDate, row.likes, row.id));
            }
            return result;
        });
    }
// Find all posts matching the supplied SQL 'where' clause
Find all posts matching the supplied SQL 'where' clause
Find all posts matching the supplied SQL ' where ' clause
static byWhere(where, order) {
        return __awaiter(this, void 0, void 0, function* () {
            const rows = yield alasql_1.default.promise(`select id, creator, message, creationDate, likes
             from posts
             where ${where}
             ` + (order ? `order by ${order}` : ''));
            const result = [];
            for (const row of rows) {
                const creator = yield user_1.default.byId(row.creator);
                if (creator)
                    result.push(new Post(creator, row.message, row.creationDate, row.likes, row.id));
            }
            return result;
        });
    }
static byWhere ( where , order ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { const rows = yield alasql_1 . default . promise ( ` ${ where } ` + ( order ? ` ${ order } ` : '' ) ) ; const result = [ ] ; for ( const row of rows ) { const creator = yield user_1 . default . byId ( row . creator ) ; if ( creator ) result . push ( new Post ( creator , row . message , row . creationDate , row . likes , row . id ) ) ; } return result ; } ) ; }
Find all posts matching the supplied SQL 'where' clause
Find all posts matching the supplied SQL ' where ' clause