Posts

Showing posts with the label database

How to migrate data from SQLite to PostgreSQL in Django

Image
  Hi DEVs! In this post I want to talk about differences between SQLite and PostgreSQL. In addition, I will show you how to migrate your data from SQLite to PostgreSQL. Well, SQLite and PostgreSQL are the most widely used relational database management systems. They are both open-source and free. However, they have some major differences that should be considered when choosing a database to use for your applications. There is a lot articles on internet which covers this topic, so I will not focus on comparison of these databases. SQLite vs PostgreSQL - Which database to use and why? SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems SQLite is too "light" for real world applications, so majority of developers prefer to use MySQL or PostgreSQL for web applications. Generally, SQLite is highly useful for: Standalone apps Small apps that don’t require expansion Apps need to read or write files to disk directly The internet of things devices Deve...

How to change PostgreSQL database encoding to UTF8

  The default encoding of the template databases in PostgreSQL is set to SQL_ASCII. If this encoding has not been changed, then the new databases will be created using this template and hence will have the same encoding SQL_ASCII. Overall this should not be a big problem unless Unicode data is required to be saved in the database. In that case you will receive an error such as : Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8. In this blog, we will go through all steps in order to change the encoding of the database to UTF8. First of all one needs to know that encoding of already created database cannot be altered. Hence we need to drop and create a new one. Checking the current server encoding. postgres@yourserver : ~ $ psql psql ( 10.7 ( Ubuntu 10.7 - 0ubuntu0 .18 . 04.1 ) ) Type "help" for help . postgres = # SHOW SERVER_ENCODING; server_encoding - - - - - - - - - - - - - - - - - SQL_ASCII ( 1 row ) po...

Getting fired up with Firebase Database

Image
One thing to wonder is how did we transmit the details from webpage to the server. Well, this is where  Firebase  comes to the rescue one more time!  lets get started with this. Step 1 : Add your project to Firebase from the  console . Click on the Blue button Step 2 : Add Firebase to your webapp Open the project, you’ve just created and click on the bright red button that says, “ Add Firebase to your web app” Copy the contents from here and paste it after your HTML code. Step 3 : Next up, navigate to the Database section in your console and move to the Rules tab. For now, let us edit the rules to allow anyone to read and write to the database. Almost all set up now. Step 4 : Modify the HTML to allow entering data by the user <form name="htmlform" id="form" enctype="multipart/form-data"> <p align="center"><b><big>FOSSASIA's App Generator</big...