Move plugin docs to plugin folders

Summary: Moved plugin documentation and related assets to plugin folders, fixed links and configured redirects where required. Now these docs are used for both showing docs in Flipper and generating Flipper docs website.

Reviewed By: passy

Differential Revision: D29465567

fbshipit-source-id: 3ec4240b215b0d5baea5154f64266a9ba7ead3a5
This commit is contained in:
Anton Nikolaev
2021-06-29 17:39:37 -07:00
committed by Facebook GitHub Bot
parent 4ad7a70ee3
commit 039d3a4a08
24 changed files with 47 additions and 192 deletions

View File

@@ -0,0 +1,14 @@
import useBaseUrl from '@docusaurus/useBaseUrl';
The Databases plugin provides developers with read-write access to their databases:
- browse your tables' data
- see your tables' structure
- execute queries
- mark queries as favorites
- see logs of past executed queries
<img alt="Databases Plugin 1" src={useBaseUrl("img/databases-plugin-1.png")} />
<img alt="Databases Plugin 2" src={useBaseUrl("img/databases-plugin-2.png")} />
Note: this plugin is only available for Android.

View File

@@ -0,0 +1,57 @@
To use the databases plugin, you need to add the plugin to your Flipper client instance. The plugin is currently only available for Android.
## Android
Instantiate and add the plugin in `FlipperClient`.
```java
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
client.addPlugin(new DatabasesFlipperPlugin(context));
```
By default it will list all sqlite databases returned by the context. If you are storing a sqlite database somewhere else, you can specify a `File` to it:
```java
client.addPlugin(new DatabasesFlipperPlugin(new SqliteDatabaseDriver(context, new SqliteDatabaseProvider() {
@Override
public List<File> getDatabaseFiles() {
List<File> databaseFiles = new ArrayList<>();
for (String databaseName : context.databaseList()) {
databaseFiles.add(context.getDatabasePath(databaseName));
}
databaseFiles.add("...path_to_your_db...")
return databaseFiles;
}
})));
```
If you use a different type of database other than sqlite, you can implement a driver to be able to access it via Flipper.
```java
client.addPlugin(new DatabasesFlipperPlugin(new DatabaseDriver(context) {
@Override
public List getDatabases() {
return null;
}
@Override
public List<String> getTableNames(DatabaseDescriptor databaseDescriptor) {
return null;
}
@Override
public DatabaseGetTableDataResponse getTableData(DatabaseDescriptor databaseDescriptor, String table, String order, boolean reverse, int start, int count) {
return null;
}
@Override
public DatabaseGetTableStructureResponse getTableStructure(DatabaseDescriptor databaseDescriptor, String table) {
return null;
}
@Override
public DatabaseExecuteSqlResponse executeSQL(DatabaseDescriptor databaseDescriptor, String query) {
return null;
}
}));
```