For instance, we can retrieve all records found in the employees table via this URI: /api/v2/mysql/_table/employees You will use these aliases to execute SQL joins via an API call.
The name column identifies the auto-generated join alias. In the case of the employees table, DreamFactory recognizes two “many to many” and four “has many” relationships.
Note the type column: DreamFactory can recognize the four common types of table relationships, including “belongs to”, “has one”, “has many”, and “many to many”. Beyond generating endpoints for interacting with tables, views, and stored procedures, DreamFactory will also scan the database schema for foreign key relationships, creating keyword aliases which can be passed along as parameters to produce a table join.įor example, after generating an API for the official MySQL example database, DreamFactory will recognize six foreign key relationships associated with the employees table: DreamFactory auto-generates JOIN aliases for foreign key relationships The DreamFactory platform is best known for its ability to auto-generate full-featured APIs with REST endpoints for a wide variety of databases ( 20 at last count, including MS SQL Server, MySQL, Oracle, and MongoDB – watch this video to learn more). Joining Related Data in a RESTful Web API
#Create join in idatabase how to#
Need an API? Did you know you can generate a full-featured, documented, and secure REST API in minutes using DreamFactory? Sign up for our free 14 day hosted trial to learn how! Our guided tour will show you how to create an API using an example MySQL database provided to you as part of the trial! In this lesson the pupils create an SQL database using DB Browser (free software) which helps them understand what tables are, the importance of field names and the data types used in an SQL database.