| 
									
										
										
										
											2023-01-08 12:10:53 +08:00
										 |  |  | import 'package:appflowy_backend/dispatch/dispatch.dart'; | 
					
						
							| 
									
										
										
										
											2023-04-28 14:08:53 +08:00
										 |  |  | import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart'; | 
					
						
							| 
									
										
										
										
											2023-01-08 12:10:53 +08:00
										 |  |  | import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; | 
					
						
							| 
									
										
										
										
											2024-02-24 20:54:10 +07:00
										 |  |  | import 'package:appflowy_result/appflowy_result.dart'; | 
					
						
							| 
									
										
										
										
											2022-04-19 21:52:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-26 16:27:17 +08:00
										 |  |  | class DatabaseBackendService { | 
					
						
							| 
									
										
										
										
											2024-03-15 22:58:55 +08:00
										 |  |  |   static Future<FlowyResult<List<DatabaseMetaPB>, FlowyError>> | 
					
						
							| 
									
										
										
										
											2023-04-03 18:50:22 -10:00
										 |  |  |       getAllDatabases() { | 
					
						
							| 
									
										
										
										
											2023-03-14 01:02:54 +08:00
										 |  |  |     return DatabaseEventGetDatabases().send().then((result) { | 
					
						
							| 
									
										
										
										
											2024-02-24 20:54:10 +07:00
										 |  |  |       return result.fold( | 
					
						
							|  |  |  |         (l) => FlowyResult.success(l.items), | 
					
						
							|  |  |  |         (r) => FlowyResult.failure(r), | 
					
						
							|  |  |  |       ); | 
					
						
							| 
									
										
										
										
											2022-11-26 21:28:08 +08:00
										 |  |  |     }); | 
					
						
							| 
									
										
										
										
											2022-03-03 10:51:52 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | } |