Skip to content
Extraits de code Groupes Projets
Valider 4cdc71ff rédigé par Tadeusz Sośnierz's avatar Tadeusz Sośnierz
Parcourir les fichiers

Workaround different JSON field handling between SQLite and Pg

parent 164c9e86
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -303,7 +303,11 @@ export class DiscordStore implements IAppserviceStorageProvider {
const rows = await this.db.All('SELECT * FROM user_activity');
const users: {[mxid: string]: any} = {};
for (const row of rows) {
users[row.user_id as string] = JSON.parse(row.data as any);
let data = row.data as any;
if (typeof data === 'string') { // sqlite has no first-class JSON
data = JSON.parse(data);
}
users[row.user_id as string] = data;
}
return { users };
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter