Updating a table in Google Cloud SQL using a third party API - mysql

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 !

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.

Related

Query large database and serve line by line

I ask this question, because I don't even have a clue what to google for. I have a MariaDB database which I access through node.js' mysql module. I write my code in TS.
My problem is, that the database I try to access will collect millions of datasets over time, and querying it might take awhile. I want would want to find a way to parse the database and serve one dataset whenever it is found instead of querying the whole database first and then sending an accumulated result.
Do you have any clue how I can solve this or what to google / YouTube search for?

can we connect our python script with a database using the url of the database

can we connect our python script to interact with the database whose url is known.If yes then how we would do that?? and will we be able to interact with the datbase??
I am going to start working on automating a process whic right now is done manually in my company by accessing a datbase and using it for extracting values or data.
Now this is my first day and i don't know from where to start.All that i know is right now i am having a url to database and the database consists of a "query section" where i will feed what i want to search using different fields of the database query page and will get a list matching my search.
i have to use this list in my GUI that i have to develop. for this purpose i need to know how to access a database using its url and how to interact with it.My database is developed using JavaScript
i am a beginner.Please folks help me with this.
You should specify your database first. e.g mysql
then you can use a ORM like SQLALCHEMY to ease the process for you and in that case this is how you address the db, something like:
"mysql://{}:{}#{}:{}"
.format("YOUR_SQL_USERNAME","YOUR_SQL_PASSWORD", "YOUR_SQL_HOST", "YOUR_SQL_PORT")

How do you incorporate Node.js/passport into my website?

I'm new to webdev and I'm trying to use passport for registration/authentication on a site I'm setting up. I'm also going to write an application in node later on that will be using some of the user data (users will need to provide an API key for an account on another site that I will use to pull data into the application).
At the moment, the main issue I'm having is figuring out what goes where. I've found plenty of resources that explain how to create an app using passport, but nothing shows how it would be incorporated into your website or where the files should be in relation to your website. I'm relatively new to Node.js, and while I've written a few small applications I have never hosted them anywhere.
Bonus question: I'm using MongoDB with passport and I was also planning to use it to store some JSON my application will be receiving from API calls. However, I wanted to use MySQL to store some data as well. More specifically, I'm planning to save the raw JSON then I'll create a relational database out of the data I need from the JSON and then keep the rest in MongoDB for easy access. Is this common/smart, or should I focus on keeping everything in my MongoDB? I'm relatively new to NoSQL.
Thanks in advance for any help.
I would reference this tutorial. I just recently used this to help myself with a new application. Also there is an example of the same thing but in SQL here. So not sure what you mean by " where the files should be in relation to your website". The information related to to authentication should go in your database.
To your "bonus question" you can use two databases. The key here is to ask yourself why and what are the true needs for data, and how is this data accessed and used. From ground up I would like one and stick with it. If at some point later you realize a certain type of data would be better in a different database then you can add it.
Side note: look into an IDE such as webstorm to help you out.

can i create a database without mysql on raspberry pi

I've got a raspberry pi with raspbian and all I've done is installed apache2 and created a small web site i want to create a database.
is this possible without using mysql or other database software. i want to use .JS or a text based database
I want to be able to save the contact details in a text format.
can someone point me in the right direction a simple example would be appreciated all online research wants mysql etc
all i want is a simple example as in enter name and submit i want that name to be logged so if name entered again it will say welcome back once i know this mechanism i can add all the other fields. The reason i want this format is so i can see the list that I'm creating.
i just can't get to grips with mysql I've spent months trying to understand mysql but its just not going in so want to simplify the database to minimal workings so i can complete my site. I know .Js isn't so secure but its a demo so security not important at this point any help appreciated
It would be possible to use JSON for your data storage. It will be a key-value storage. On each page view you will have to load the entire file into memory and parse it. From then on it is possible to loop it to search data or get data from a key. This requires no extra software just PHP with Apache.
How to:
Build an array, use json_encode to create the JSON and save it using file_put_contents(). Remebmer to save the whole array and not just the newly added element.
This is not a relative database but might do the trick if you build an intelligent system with cookie's to store an ID that is associated with a user.
Alternative you could use serialize() instead of json;
If you don't mind to use different way of storing data you can use either Google App Engine or mongolab or other cloud based databases

Connecting visual c++ to an online database

I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.