1

This feels like a noobish question to which I should be able to find the answer on the web, but after hours of searching, I still came up empty handed. The problem probably lays in the fact that I don't know exactly what I'm looking for.

What I'm trying to achieve seems simple enough: update a specific table in database that I successfully migrated to a 2nd Gen CloudSQL Instance using a suppliers API.

This table contains product information from products from this particular supplier. Constructing the correct URL (with username, password and language) returns me the data in XML format (in my browser)

So, basically my question is which path I should follow to get this data in the Google hosted database ?

Do I have to programmatically parse the XML file (i.e. using python) in the Cloud Console, updating the database table this way ?

I've also been looking in google-cloud-firestore direction...

I assume there is a more direct way doing this ?

I suppose all I need is a useful link that will get me on my way. Thanks !

hkanjih
  • 1,271
  • 1
  • 11
  • 29
oneindelijk
  • 606
  • 1
  • 6
  • 18
  • 1
    Couple links to get you on the way, https://stackoverflow.com/questions/10763171/can-sqlalchemy-be-used-with-google-cloud-sql and https://cloud.google.com/sql/docs/mysql/connect-external-app#python – fbraga Mar 26 '19 at 11:08
  • I'm still unsure about the mechanism to do this. Should I have a running vm instance running that performs the update (as the external app) ? – oneindelijk Mar 28 '19 at 11:09

1 Answers1

1

GCP console doesn't have a way to manage your data inside of your database instance.

But, you can do that using any database tools like DBVisualizer + Cloud SQL Proxy.

hkanjih
  • 1,271
  • 1
  • 11
  • 29
  • Are you saying there is no direct way to update tables from 3rd parties in the GCP ? – oneindelijk Mar 25 '19 at 20:12
  • 1
    No, I'm saying that using GCP Console (https://console.cloud.google.com/sql ) you can't do that. But, you can update this table using the same approach that you use for on-premises MySQL – hkanjih Mar 25 '19 at 21:03
  • Could you give me some information on that approach ? – oneindelijk Apr 05 '19 at 09:15
  • Sure, what is your question about it ? – hkanjih Apr 05 '19 at 14:32
  • I have a database with one table that should be updated from an xml-file which is returned by an url request (get, post or soap). The table should be refreshed every day. I was trying out in the GCP, mysql `LOAD XML INFILE`, which seems to work, but the xml file I got with wget from this url seems to be a text-string, which is the real xmlfile, but wrongly decoded, inside a UTF-8 encoded xmlfile – oneindelijk Apr 24 '19 at 11:47