<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Timileyin D</title>
    <description>The latest articles on DEV Community by Timileyin D (@0xps1).</description>
    <link>https://dev.to/0xps1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1134189%2F46d98ae7-3e4e-4762-8a35-bfdb56c9e92d.jpeg</url>
      <title>DEV Community: Timileyin D</title>
      <link>https://dev.to/0xps1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0xps1"/>
    <language>en</language>
    <item>
      <title>Introduction Cyber Security</title>
      <dc:creator>Timileyin D</dc:creator>
      <pubDate>Sun, 11 Feb 2024 11:42:39 +0000</pubDate>
      <link>https://dev.to/0xps1/introduction-cyber-security-23l4</link>
      <guid>https://dev.to/0xps1/introduction-cyber-security-23l4</guid>
      <description>&lt;p&gt;From my experience, I will define cyber security as the science or an art of keeping business in business.&lt;br&gt;
It is a deliberate attempt to keep business safe on the internet.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>go</category>
    </item>
    <item>
      <title>Introduction Cyber Security</title>
      <dc:creator>Timileyin D</dc:creator>
      <pubDate>Sun, 11 Feb 2024 11:42:34 +0000</pubDate>
      <link>https://dev.to/0xps1/introduction-cyber-security-38n6</link>
      <guid>https://dev.to/0xps1/introduction-cyber-security-38n6</guid>
      <description>&lt;p&gt;From my experience, I will define cyber security as the science or an art of keeping business in business.&lt;br&gt;
It is a deliberate attempt to keep business safe on the internet.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>go</category>
    </item>
    <item>
      <title>How to use SQLC with Golang</title>
      <dc:creator>Timileyin D</dc:creator>
      <pubDate>Wed, 03 Jan 2024 10:16:07 +0000</pubDate>
      <link>https://dev.to/0xps1/how-to-use-sqlc-with-golang-120b</link>
      <guid>https://dev.to/0xps1/how-to-use-sqlc-with-golang-120b</guid>
      <description>&lt;h2&gt;
  
  
  What is SQLC
&lt;/h2&gt;

&lt;p&gt;SQLC is a type-safe SQL code generator, it is used to generates fully type-safe idiomatic code from SQL and catch failure before they happen, it support different languages like Golang, Kotlin and Python. The main advantage of using SQLC is that it generate type-safe code from the SQL queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  How SQLC work
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You write SQL queries&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You run sqlc to generate Go code that presents type-safe interfaces to those queries&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You write application code that calls the methods sqlc generated&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SQLC golang sample
&lt;/h3&gt;

&lt;p&gt;To get started, we need to navigate to the desired directory and run the command below in our terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir sqlc_go &amp;amp;&amp;amp; cd sqlc_go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;also create db/migration and db/queries folder&lt;/p&gt;

&lt;p&gt;Implementing SQLC in golang involves installing *&lt;em&gt;golang-migrate *&lt;/em&gt; package,this helps to fully utilize SQLC full potential.&lt;/p&gt;

&lt;p&gt;We proceed to install the required golang-migrate dependencies with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl -L https://github.com/golang-migrate/migrate/releases/download/$version/migrate.$os-$arch.tar.gz | tar xvz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above install golang-migrate. We can then proceed to creating the migration file for the user by running the below code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;migrate create -ext sql -dir db/migration -seq add_users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate two serialized  file that looks like the image attached below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4cmld7llfxraxjrow5jo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4cmld7llfxraxjrow5jo.PNG" alt="Image description" width="424" height="104"&gt;&lt;/a&gt;&lt;br&gt;
where the .up.sql file is for the SQL query model definition while the .down.sql file is for changes reversal. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Insert the SQL query into the .up.sql file. see 
the code below&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdn51ikrs79amg162zaq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdn51ikrs79amg162zaq.PNG" alt="Image description" width="800" height="319"&gt;&lt;/a&gt;&lt;br&gt;
while the below code inside the .down.sql file&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flimpwlma3w6r8vs6oost.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flimpwlma3w6r8vs6oost.PNG" alt="Image description" width="672" height="290"&gt;&lt;/a&gt;&lt;br&gt;
The code in the .down.sql file will be use to reverse the changes made to the database(DB)&lt;/p&gt;

&lt;p&gt;The user.sql file in the db/queries folder will contain the code below which instruct SQLC on the method to be generated.&lt;br&gt;
It will create CreateUser, GetUser among other method&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6mi1jpynbu4t41ymhco.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6mi1jpynbu4t41ymhco.PNG" alt="Image description" width="672" height="716"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pull a Postgres image from the docker hub and create a database on the running Postgres instance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create sqlc.yaml by running&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlc init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;(image below) to set the configuration for the SQLC&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6geji2oct7cpy8p1alg.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6geji2oct7cpy8p1alg.PNG" alt="Image description" width="800" height="818"&gt;&lt;/a&gt;&lt;br&gt;
The code above instruct golang-migrate to look out for the db/migration folder when the migration code below is been executed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;migrate -path db/migration -database "$(DB_URL)" -verbose up 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlc generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the code above will create sqlc folder in the db folder also create a db.go file in the db/sqlc folder&lt;br&gt;
which explicitly define the database architecture and database method that can be used in our controller, remember this method was defined in our db/queries folder. Image attached below &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5c6ar96k1lim43eyaw2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5c6ar96k1lim43eyaw2.gif" alt="Image description" width="576" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This article demonstrate how to use SQLC in a golang application, its role in building type-safe idiomatic code and how to get started by building a user management service with Golang and Postgres DB. &lt;/p&gt;

</description>
      <category>sqlc</category>
      <category>go</category>
      <category>postgres</category>
      <category>backend</category>
    </item>
    <item>
      <title>The Basics of Web Development: A Comprehensive Guide for Beginners</title>
      <dc:creator>Timileyin D</dc:creator>
      <pubDate>Mon, 01 Jan 2024 15:52:13 +0000</pubDate>
      <link>https://dev.to/0xps1/the-basics-of-web-development-a-comprehensive-guide-for-beginners-93d</link>
      <guid>https://dev.to/0xps1/the-basics-of-web-development-a-comprehensive-guide-for-beginners-93d</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the fast-evolving world of technology, understanding the basics of web development has become an essential skill. Whether you're an aspiring developer, a business owner looking to build an online presence, or simply curious about how websites work, this comprehensive guide will provide you with a solid foundation in web development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Web Development?
&lt;/h2&gt;

&lt;p&gt;Web development encompasses the creation and maintenance of websites and web applications. It involves a combination of programming, design, and problem-solving skills. There are two main components of web development:&lt;/p&gt;

&lt;h2&gt;
  
  
  Front-End Development
&lt;/h2&gt;

&lt;p&gt;Front-end development focuses on the user interface and user experience. It involves designing and building the elements that users interact with directly. HTML, CSS, and JavaScript are fundamental languages in front-end development. HTML structures the content, CSS styles it, and JavaScript adds interactivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Back-End Development
&lt;/h2&gt;

&lt;p&gt;Back-end development involves server-side programming, databases, and server management. It's responsible for the functionality of the website, handling data, and ensuring smooth communication between the front end and the server. Common back-end languages include Python, Ruby, PHP, and Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Technologies in Web Development
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML (Hypertext Markup Language)&lt;/strong&gt;: HTML is the backbone of web development. It structures content on the web, defining elements like headings, paragraphs, and images and below is how the HTML skeleton looks like&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspdcz1a6aphvjfqti0yv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspdcz1a6aphvjfqti0yv.PNG" alt="Image description" width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSS (Cascading Style Sheets)&lt;/strong&gt;: CSS is used to style HTML elements, making websites visually appealing. It controls layout, colors, fonts, and overall design.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;: According to &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript" rel="noopener noreferrer"&gt;MDN&lt;/a&gt; JavaScript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes.  JavaScript adds interactivity to websites. It enables features like dynamic content, form validation, and the manipulation of webpage elements in real-time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Responsive Design&lt;/strong&gt;: With the increasing use of various devices, responsive design ensures that websites look and function well on desktops, tablets, and smartphones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Frameworks and Libraries&lt;/strong&gt;: Frameworks like React.js and Angular.js, as well as libraries like jQuery, streamline the development process by providing pre-written code and structure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server-Side Development&lt;/strong&gt;: For back-end development, understanding server-side languages (e.g., Node.js, Django, Gin and Fibre) and databases (e.g., MySQL, MongoDB) is crucial.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Learning Resources for Beginners
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Online Courses&lt;/strong&gt;: Platforms like Codecademy, Udacity, and freeCodeCamp offer interactive courses for beginners to learn web development step by step.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Documentation&lt;/strong&gt;: Explore the official documentation of web technologies. For instance, MDN Web Docs is an excellent resource for HTML, CSS, and JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community and Forums&lt;/strong&gt;: Engage with the web development community on platforms like Stack Overflow, Reddit (e.g., r/webdev), and join forums to seek advice and solutions to common problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Projects&lt;/strong&gt;: Apply your knowledge by working on small projects. Building a personal portfolio or a simple website allows you to practice and showcase your skills.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Web development is an exciting and dynamic field that welcomes beginners with open arms. By mastering the basics, exploring key technologies, and engaging with the community, you'll pave the way for a rewarding journey into the world of web development. Remember, practice and continuous learning are the keys to becoming a proficient web developer. So, roll up your sleeves, dive into the code, and embark on your web development adventure!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Golang Database Migration With Golang Migrate and Sqlc</title>
      <dc:creator>Timileyin D</dc:creator>
      <pubDate>Fri, 11 Aug 2023 13:55:01 +0000</pubDate>
      <link>https://dev.to/0xps1/golang-database-migration-with-golang-migrate-and-sqlc-4bck</link>
      <guid>https://dev.to/0xps1/golang-database-migration-with-golang-migrate-and-sqlc-4bck</guid>
      <description>&lt;p&gt;Database migrations are a crucial component of controlling a software application's evolution. They give programmers the ability to modify the database schema while maintaining the accuracy and consistency of the data. Golang-migrate, a strong library for the Go programming language, offers a practical method for managing database migrations. In this article, we'll look at how to do efficient database migrations in Go using golang-migrate.&lt;br&gt;
Firstly, let's start by answering:&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is SQLC
&lt;/h2&gt;

&lt;p&gt;SQLC stands for &lt;strong&gt;SQL Compiler&lt;/strong&gt; is a tool and framework used for type-safe SQL queries in Go programming. SQLC allows you to write SQL queries as part of your Go code, and it automatically generates Go code that represents those queries as native Go functions. like we defined it earlier it is just a framework to generate type safe queries in Golang.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started With Golang Migrate&lt;/strong&gt;&lt;br&gt;
To start with golang migrate you have to first install Golang on your machine. &lt;a href="https://go.dev/doc/install" rel="noopener noreferrer"&gt;Here&lt;/a&gt; is the link to download Go for your respective device OS then get your project setup.&lt;br&gt;
The next thing is to install golang migrate&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

go get -u -d github.com/golang-migrate/migrate/cmd/migrate


```             or `brew install golang-migrate` for Mac OS 

You can use golang-migrate to manage your database migrations once the installation is complete.



## How To Create A Migration

Running a golang `migrate create` command will help you create a sequence up and down .sql file for your migration name. This SQL files are used by Golang-migrate to specify database migrations. Each migration file contains a series of SQL statements that must be run and reflects a particular version of the database schema.
And below is the command to generate a migration files

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;migrate create -ext sql -dir   -seq {theName}&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This command will generate a new migration file in the specified directory with a name reflecting the migration version and a descriptive name. 
For example: ```


migrate create -ext sql -dir  &amp;lt;db/migration&amp;gt; -seq init-schema


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will generate this files for us in the db/migration folder&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8bmxufh6iysi4ye6dq3h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8bmxufh6iysi4ye6dq3h.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;where the &lt;strong&gt;up.sql&lt;/strong&gt; file is use to make changes to the database why &lt;strong&gt;down.sql&lt;/strong&gt; file is to revert the changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To use the migration file
&lt;/h2&gt;

&lt;p&gt;Below is an instance of how  to use the migration file in the generated init-schema.up.sql file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1g234ieq4auzeuqrknuz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1g234ieq4auzeuqrknuz.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the image above is our SQL queries to create &lt;strong&gt;users&lt;/strong&gt; table in the table and below is how to revert the changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vt2du2tfnjtgz4h0kpf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vt2du2tfnjtgz4h0kpf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above steps has create for us migration file, the next step is to migrate the schema migration file to the Database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrating the migration file to the database.
&lt;/h2&gt;

&lt;p&gt;The code below shows how to migrate a migration file to a Postgres Database&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv41ursrmp9vwvow2nkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv41ursrmp9vwvow2nkc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;where &lt;strong&gt;root&lt;/strong&gt; is the username and &lt;strong&gt;secret&lt;/strong&gt; is the password, &lt;strong&gt;localhost&lt;/strong&gt; is the host, &lt;strong&gt;5432&lt;/strong&gt; is the port and &lt;strong&gt;Sample&lt;/strong&gt; is the name of the database to migrate into.&lt;/p&gt;

&lt;p&gt;To remove such migration from the DB also, all we have to do is to run this command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hejp0ptva2ov9vxvgtk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hejp0ptva2ov9vxvgtk.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In the next article I will explain how to generate CRUD Golang code from the SQL files.&lt;/p&gt;

&lt;p&gt;I hope you learn a thing or two from this, see you in the next one.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>sql</category>
      <category>go</category>
      <category>database</category>
    </item>
  </channel>
</rss>
