Page 1 of 1

Database options for application that needs to retrieve information

Posted: Mon Aug 23, 2021 11:33 am
by rslaav
Product, version and build: Latest as of Aug 2021, Full DevOps suite.
Operating system: Windows 10

Hi everyone, I am trying to build a script or at least a set of scripts with a GUI frontend that essentially needs to pull information from a database. This database can be on the same system, or possibly online. What I am trying to build is a security policy maker that requires various pieces of data that do not need to be part of the application. My thoughts at first were to use access as it could be pulled from a different machine on the network, but then I thought why not make something available to everyone and have a database online by using something like a db as a service.

SQL might be a little convoluted for me, and I was thinking of using MongoDB. Is this possible? If there are other options, please let inform me, as this is my first time trying to use the software for anything database related. I have a license for the DevOps package, so I have access to the whole suite of Sapien software.

Re: Database options for application that needs to retrieve information

Posted: Mon Aug 23, 2021 1:00 pm
by brittneyr
As long as the connection can be established for your MongoDB database, you should be able to do this.
As for establishing this connection in Product, neither PrimalSQL or PowerShell Studio are tested against MongoDB, but I believe you could connect via the ODBC option.
Once the connection and sql work, you can export the script to a query form from PrimalSQL:
PQL_ExportToPSF.png
PQL_ExportToPSF.png (38.99 KiB) Viewed 44019 times
From PowerShell Studio, you can generate q query form from the Database pane in the Object Browser panel:
SPS_GenerateQueryForm.png
SPS_GenerateQueryForm.png (37.49 KiB) Viewed 44019 times
Though the GUI generated may not be exactly what you are looking for, it should be a good starting point as it generates the necessary code to display database information in a GUI.

You may find the following article helpful:
https://reszolver.wordpress.com/2017/01 ... owershell/

Also, PowerShell Studio (5.8.192) recently was updated to support running sql files.

Re: Database options for application that needs to retrieve information

Posted: Mon Aug 23, 2021 3:05 pm
by rslaav
Awesome, that's a perfect starting point for me. I will likely use mongodb as a cloud service to start as they have this tool to help you view the collections neatly. I am hoping I won't have to install mongodb drivers to connect, but if so I suppose I'll need to add it to what I am building. Thank you :)