Database Miscellaneous

0

No comments posted yet

Comments

Slide 1

Database Miscellaneous

Slide 2

Overview Objectives Learn about some of the miscellaneous features that PVDatabase has to offer. Requirements Knowledge of PVDatabase basic functions. Estimated Time 5 minutes

Slide 3

Random At points you may want to query data by at random. Databases have the random function built in. To utilize that random function, we can use PVDatabase::getSQLRandomOperator().

Slide 4

Average The average function is used for finding the average value of data in a database. We leverage the average function in ProdigyView like so:

Slide 5

Database Type Prodigyview supports multiple database types and connections to a database can be switched at any moment. To get what database you are connectioned to, you can use the PVDatabase::getDatabaseType method.

Slide 6

Schema Some database, such as postgresql, generally are used with schemas. To get the schema that is currently in use, the getSchema() method can be utilized.

Slide 7

Table Formatting When writing an application that is be distributed, you will not know the prefix of database used. PVDatabase::formatTable() will add the prefix set for the current database connection in front of the table. If the prefix set as ‘pv_’, the code below will output ‘pv_template’.

Slide 8

Predefined Tables ProdigyView stores data in predefined tables for features such applications, plugins, cms, menus, etc. PVDatabase can retrieve the names of those tables in the correct format of the database being used. Example: If the database set has the prefix of pv_ and schema of production, PVDatabase::getApplicationTableName() will return production.pv_applications. The following areas have predefined tables: CMS Applications Plugins Users Menus Modules Containers Pages Templates Template Positions Subscriptions Points MVC Roles

Slide 9

API Reference For a better understanding of the database, visit the api by clicking on the link below. PVDatabase www.prodigyview.com More Tutorials For more tutorials, please visit: http://www.prodigyview.com/tutorials

Summary: Explore some of the miscellaneous features of PVDatabase.

Tags: columns database how-to mssql mysql php postgresql prodigyview sql tables tutorial

URL: