Skip to main content
1-Visitor
September 14, 2020
Question

How to send/connect data with Vuforia Studio and postgres SQL

  • September 14, 2020
  • 2 replies
  • 2004 views

May i know how to connect vuforia studio to postgres database?I want to send my data to database,hopefully you can give some opinion and guide.Thanks

2 replies

17-Peridot
September 14, 2020

Hello Fikhrul_Edham8, 

 

The solution is to install PostgREST :

https://github.com/PostgREST/postgrest

http://postgrest.org/en/v7.0.0/

 

It is a tiers web server in front of Postgrest Database.

It allows HTTP requests to run Functions embbeded in Postgres Database who runs SQL queries.

It is possible to have results of data in JSON format.

 

In Vuforia Studio, in Project, only http requests in javascript is needed.

More details in this thread for example :

https://stackoverflow.com/questions/36975619/how-to-call-a-rest-web-service-api-from-javascript

 

  • Is it helping you ?

 

Best regards,

Samuel

 

1-Visitor
September 16, 2020

I already install postgres SQL but I don't know how to connect with Vuforia Studio. Where should I paste the code in vuforia? Perhaps can you guide me step by step on how to achieve this solution? Because I'm new in vuforia studio. Thank you for your response.

17-Peridot
September 16, 2020

Hello,

 

Please follow these steps :

  1.  Read the documentation about this third-party server to run SQL queries with REST http request in postgres database: http://postgrest.org/en/v7.0.0/
  2. Follow steps described to install it. More details in this web page: http://postgrest.org/en/v7.0.0/tutorials/tut0.html
  3. Please not that this server is not included in postgres database and in Vuforia Studio
  4.  Install Vuforia Studio as described in Help Center : http://support.ptc.com/help/vuforia/studio/en/index.html#page/Studio_Help_Center/common/VuforiaBeta_InstallThingBuilderWindows_Commercial.html
  5. In Help Center, we can find various tutorial at various levels (beginner, advanced ...etc...)
  6. For example, create a Project at:http://support.ptc.com/help/vuforia/studio/en/index.html#page/Studio_Help_Center%2FBeginner_CreateAndPublish.html%23
  7. How to invoke a JavaScript Function from a Buttonhttp://support.ptc.com/help/vuforia/studio/en/index.html#page/Studio_Help_Center%2FBeginner_JSInvokeFunction.html%23
  8. For your needs: create a Project, create a JavaScript function who calls by using REST api an HTTP request to PostgresREST server who will runs a SQL query in Postgres database.

 

Best regards,

Samuel

19-Tanzanite
September 17, 2020

Hi @Fikhrul_Edham8 

 

Make use of Thingworx to communicate between PostgreSQL and Vuforia Studio.

 

Refer this article for Thingworx and External DB connection setup

 

/VR