Database options for application that needs to retrieve information

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
rslaav
Posts: 18
Last visit: Wed Aug 25, 2021 11:43 am

Database options for application that needs to retrieve information

Post 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.

User avatar
brittneyr
Site Admin
Posts: 858
Last visit: Wed Sep 22, 2021 11:24 am
Answers: 17
Been upvoted: 15 times

Re: Database options for application that needs to retrieve information

Post 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 2492 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 2492 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.
Brittney Ryn
SAPIEN Technologies, Inc.

rslaav
Posts: 18
Last visit: Wed Aug 25, 2021 11:43 am

Re: Database options for application that needs to retrieve information

Post 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 :)