Explore and Associate DB Objects (Tables)
Overview
In this lesson we will review how to explore and associate existing databases objects including tables, stored procedures and functions. We will also showcase Tables related features but the same concepts and features apply to Stored Procedures and Functions.
How to explore Database Tables?
Before getting started make sure you have a Wayfast Project created and a requirement in “Active” status.
First let’s click on “Database” icon at the top menu.
In the Submenu, click on “Tables”
Wayfast will display the different Transactional, Master data and Business data tables in grid view dashboard.
Each table type is treated differently when you deploy your application to QA or Production environments.
Type | Description |
---|---|
Transactional Tables | This kind of tables will be synchronized considering only structure. Data will not travel from development environment to other environments. |
Master Tables | This kind of tables will be synchronized considering structure and data. This tables are meant for configurations that will not be modified during application’s life unless there is a new App version. |
Business Tables | This kind of tables will NOT be synchronized during deployments. This tables are meant to query tables created outside the application development. This can be useful if you are reusing tables from a different system accessing DB directly or if you are dealing with legacy tables. |
Log Tables | This tables are meant for app’s tracing features. Data inserted in this table will be automatically cleared after a configurable period. |
How to associate Tables from other databases?
Click on “Associating Tables” button and a popup will be displayed on screen.
We need to choose a SQL Server instance and Database to locate the “Object” we want to associate.
Clicking the magnifying glass in the “Object” field will retrieves all the tables available. Keep in mind that if you don’t see an object you recently added to the DB you may need to “Synchronize” the DB with Wayfast.
Select the desired table an click on the “Assign” button.
Now that we associated this “Table” to the Project we are able to see it in the list and use it as part of our project.
This feature will work only if we associated another existing database to the Project. If we only have the database created for this project, Wayfast won’t retrieve any other database and their tables.
How to create a new Table in SQL and synchronize it on Wayfast?
Let’s open SQL Server Management Studio and connect to the DB associated to the Project.
In a new query, create a new table with the following data settings:
CREATE TABLE EmployeeDemo(
FirstName NVARCHAR (50) COLLATE DATABASE_DEFAULT NULL,
LastName NVARCHAR (50) COLLATE DATABASE_DEFAULT NULL,
Role NVARCHAR(50) COLLATE DATABASE_DEFAULT NULL,
Age INT NULL,
)
Wayfast automatically includes an ID field when creating tables as part of the Database framework.
Execute the query and verify that the Table has been created. Then return to Wayfast and click on the database menu icon. In the submenu click “SynchronizeDB”.
Click on “End Task” in the “Active” requirement
A popup is displayed, just click on the “Synchronize” button
Return to Database-Table submenu
Now we are able to see the new table in the “Transactional Tables” grid including related “Instance” and “Database”.
Recap
In this lesson, we learnt how to associate existent tables in our Project’s database. We observed how the new tables were created in SQL Server Management Studio are who to synchronize them to make them available in Wayfast. Remember this same steps are applicable for other database objects like views and stored procedures.