@@ -57,6 +57,7 @@ These are all the configuration options and their default value between brackets
57
57
- "username": Username of the user connecting to the database (no default)
58
58
- "password": Password of the user connecting to the database (no default)
59
59
- "database": Database the connecting is made to (no default)
60
+ - "mapping": Comma separated list of table/column mappings (no mappping)
60
61
- "tables": Comma separated list of tables to publish (defaults to 'all')
61
62
- "middlewares": List of middlewares to load (` cors ` )
62
63
- "controllers": List of controllers to load (` records,geojson,openapi,status ` )
@@ -112,6 +113,7 @@ The following features are supported:
112
113
- Atomic increment support via PATCH (for counters)
113
114
- Binary fields supported with base64 encoding
114
115
- Spatial/GIS fields and filters supported with WKT and GeoJSON
116
+ - Mapping table and column names to support legacy systems
115
117
- Generate API documentation using OpenAPI tools
116
118
- Authentication via API key, JWT token or username/password
117
119
- Database connection parameters may depend on authentication
@@ -624,6 +626,17 @@ The following Geometry types are supported by the GeoJSON implementation:
624
626
625
627
The GeoJSON functionality is enabled by default, but can be disabled using the "controllers" configuration.
626
628
629
+ ## Mapping names for legacy systems
630
+
631
+ To support creating an API for (a part of) a legacy system (such as Wordpress) you may want to map the table and column names as you
632
+ may not be able to alter them without breaking the software. The config allows you to rename tables and columns with a
633
+ comma separated list of mappings that are split with an equal sign, like this:
634
+
635
+ 'mapping' => 'wp_posts=posts,wp_posts.ID=posts.id',
636
+
637
+ This specific example will expose the "wp_posts" table as "posts" and the field "ID" within that table as "id" (notice
638
+ the casing).
639
+
627
640
## Middleware
628
641
629
642
You can enable the following middleware using the "middlewares" config parameter:
0 commit comments