Copy link to clipboard
Copied
Is this possible to comunicate with sql database using UXP?
Right now I can achieve this in Extend Script with Porky.
But maybe it's time to use more modern technology?
Copy link to clipboard
Copied
I think it should be.
Have a look at Axios or Fetch API for server side http requests with databases.
Or you could maybe with Node.js too. Node.js can directly access database, if you're using Node.js environment.
Copy link to clipboard
Copied
Hi @Mnietek1, I'm a raw beginner on this topic, but I'm fairly sure that Eugene is right. With UXP, in fact, I think you basically don't need Porky because you can use node.js packages straight out of the box, so to speak. As a starting point you could look at Porky code to see what node packages it uses. The docs say dependencies are "request, sqlite3, mysql, pg, xml2js, htmlparser, markdown, brucedown and html-entities", but also that a standard npm install includes these. But as Eugene alludes, there may be more-modern packages to do the same thing now.
- Mark
Copy link to clipboard
Copied
I pull information from the SQL databases at work with XMLHttpRequest. It not pulling directly but calling on php scripts set up to get the correct information. Just know with UXP you have to have the right permissions setup in you manifest, at least if it is a UXP plugin.