Solian/lib/providers/database/tables/json.dart
2024-09-14 00:30:33 +08:00

14 lines
282 B
Dart

import 'dart:convert';
import 'package:drift/drift.dart';
class JsonConverter extends TypeConverter<Object?, String> {
const JsonConverter();
@override
Object? fromSql(String fromDb) => jsonDecode(fromDb);
@override
String toSql(Object? value) => jsonEncode(value);
}