<?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: Oleksandr Holyshevskyi</title>
    <description>The latest articles on DEV Community by Oleksandr Holyshevskyi (@oholyshevskyi).</description>
    <link>https://dev.to/oholyshevskyi</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%2F1190987%2Fc3622fac-3061-4dd8-91d4-17cb5f318a7c.jpeg</url>
      <title>DEV Community: Oleksandr Holyshevskyi</title>
      <link>https://dev.to/oholyshevskyi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oholyshevskyi"/>
    <language>en</language>
    <item>
      <title>Mastering SQL Transactions: The Power of COMMIT and ROLLBACK in Database Management</title>
      <dc:creator>Oleksandr Holyshevskyi</dc:creator>
      <pubDate>Fri, 29 Dec 2023 13:01:07 +0000</pubDate>
      <link>https://dev.to/oholyshevskyi/mastering-sql-transactions-the-power-of-commit-and-rollback-in-database-management-4nm0</link>
      <guid>https://dev.to/oholyshevskyi/mastering-sql-transactions-the-power-of-commit-and-rollback-in-database-management-4nm0</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;a id="introduction"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SQL transactions are a fundamental aspect of database management that play a crucial role in maintaining data integrity. &lt;br&gt;
Among the key components of transactions, the COMMIT statement stands out as a linchpin for ensuring that changes made to a database are permanent. &lt;br&gt;
In this blog post, we'll explore what SQL transactions and the COMMIT statement are, the problems they solve, and how to use SQL queries with and without transactions.&lt;/p&gt;

&lt;p&gt;What is a SQL Transaction?&lt;br&gt;
In the database world, a transaction is a sequence of one or more SQL statements that are executed as a single unit of work. &lt;br&gt;
The primary purpose of transactions is to maintain the consistency and integrity of data. &lt;br&gt;
A transaction typically involves multiple steps, such as reading data, making changes, and saving those changes to the database.&lt;/p&gt;
&lt;h1&gt;
  
  
  The COMMIT Statement
&lt;/h1&gt;

&lt;p&gt;&lt;a id="the-commit-statement"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The COMMIT statement is a critical part of the SQL transaction model. When a COMMIT statement is executed, &lt;br&gt;
it marks the end of a transaction, confirming that all changes made during the transaction are permanent and should be saved to the database. &lt;br&gt;
In other words, COMMIT is like saying, "&lt;em&gt;I'm done with my changes; please make them permanent.&lt;/em&gt;"&lt;/p&gt;
&lt;h1&gt;
  
  
  Problems Solved by COMMIT
&lt;/h1&gt;

&lt;p&gt;&lt;a id="problems-solved-by-commit"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data Consistency: COMMIT ensures that a transaction is completed successfully before making changes permanent. 
If an error occurs during the transaction, the COMMIT is not executed, and the changes are rolled back, maintaining the consistency of the data.&lt;/li&gt;
&lt;li&gt;Concurrency Control: In multi-user environments, transactions help manage concurrent access to data. 
COMMIT ensures that one transaction's changes do not interfere with another's until explicitly instructed to do so.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;
  
  
  Use COMMIT
&lt;/h1&gt;

&lt;p&gt;&lt;a id="use-commit"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to Use SQL Queries with and without Transactions (COMMIT):&lt;/p&gt;
&lt;h2&gt;
  
  
  Without Transactions (Auto-Commit mode)
&lt;/h2&gt;

&lt;p&gt;&lt;a id="without-transactions-auto-commit-mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In many database systems, SQL statements are executed in auto-commit mode by default. Each statement is treated as a separate transaction, and changes are automatically committed to the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Auto-commit mode (default behavior)&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'John Doe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;-- The above statement is automatically committed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  With Transactions (Manual COMMIT)
&lt;/h2&gt;

&lt;p&gt;&lt;a id="with-transactions-manual-commit"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consider a scenario where you need to transfer funds between two bank accounts. &lt;br&gt;
Using transactions ensures the atomicity of the operation, meaning either the entire transaction succeeds, or it fails entirely with no partial changes committed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Start a transaction&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt; &lt;span class="n"&gt;TRANSACTION&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Deduct funds from Account A&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Add funds to Account B&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'B'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Commit the transaction&lt;/span&gt;
&lt;span class="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- or Rollback the transaction in case of errors&lt;/span&gt;
&lt;span class="c1"&gt;-- ROLLBACK;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits of Using Transactions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Atomicity:&lt;/li&gt;
&lt;li&gt;Ensures that a series of SQL statements are treated as a single, indivisible unit of work.&lt;/li&gt;
&lt;li&gt;Either all changes are committed, or none are.&lt;/li&gt;
&lt;li&gt;Consistency:&lt;/li&gt;
&lt;li&gt;Maintains the integrity and consistency of data, as the changes are applied as a cohesive whole.&lt;/li&gt;
&lt;li&gt;Isolation:&lt;/li&gt;
&lt;li&gt;Provides a level of isolation between transactions, preventing interference between concurrent operations.&lt;/li&gt;
&lt;li&gt;Durability:&lt;/li&gt;
&lt;li&gt;Guarantees that committed transactions are permanent and survive system failures.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;a id="conclusion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Understanding SQL transactions and the role of COMMIT is crucial for maintaining data integrity and consistency. &lt;br&gt;
Whether you're working in auto-commit mode or manually managing transactions, being mindful of these concepts ensures that your database operations are robust and reliable.&lt;/p&gt;

&lt;p&gt;Originally posted on &lt;a href="https://oholsyhevskyi.com/blog/commit-and-rollback-in-db"&gt;https://oholsyhevskyi.com/blog/commit-and-rollback-in-db&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>learning</category>
      <category>sqlserver</category>
    </item>
    <item>
      <title>🌟 Functional Programming in Automation Testing with TypeScript and Playwright 🤖🚀 Part II</title>
      <dc:creator>Oleksandr Holyshevskyi</dc:creator>
      <pubDate>Wed, 25 Oct 2023 07:17:43 +0000</pubDate>
      <link>https://dev.to/oholyshevskyi/functional-programming-in-automation-testing-with-typescript-and-playwright-part-ii-1je0</link>
      <guid>https://dev.to/oholyshevskyi/functional-programming-in-automation-testing-with-typescript-and-playwright-part-ii-1je0</guid>
      <description>&lt;p&gt;Welcome to the second part of our exploration into functional programming in automation testing. In this continuation, we will delve deeper into the practical implementation of the concepts we've &lt;br&gt;
&lt;a href="https://oholsyhevskyi.com/posts/functional-programming-in-automation-testing-partI"&gt;&lt;strong&gt;discussed so far&lt;/strong&gt;&lt;/a&gt;. &lt;br&gt;
Here's what you can expect in this part:&lt;/p&gt;



&lt;ul&gt;
&lt;li&gt;
Installing Required Libraries

&lt;ul&gt;
&lt;li&gt;Step 1: Install TypeScript&lt;/li&gt;
&lt;li&gt;Step 2: Install Playwright&lt;/li&gt;
&lt;li&gt;Step 3: Install fp-ts (Functional Programming in TypeScript)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing Required Libraries
&lt;/h2&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are step-by-step instructions for installing TypeScript, Playwright, and fp-ts. We'll also include code snippets and commands to help you through the installation process. &lt;br&gt;
Please note that you need Node.js installed before proceeding with these installations. If you haven't already installed Node.js, you can download it from the official website: &lt;a href="https://nodejs.org"&gt;&lt;strong&gt;Node.js&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install TypeScript
&lt;/h3&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your command-line interface (CLI) or terminal.&lt;/li&gt;
&lt;li&gt;Use Node Package Manager (npm) to install TypeScript globally:
&lt;/li&gt;
&lt;/ol&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g typescript
&lt;/code&gt;&lt;/pre&gt;



&lt;ol&gt;
&lt;li&gt;Verify the TypeScript installation by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tsc --version
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;This command should display the installed TypeScript version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Install Playwright
&lt;/h3&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your CLI or terminal.&lt;/li&gt;
&lt;li&gt;Create a new directory for your Playwright project, if you haven't already:
&lt;/li&gt;
&lt;/ol&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir my-playwright-project-fp
cd my-playwright-project-fp
&lt;/code&gt;&lt;/pre&gt;



&lt;ol&gt;
&lt;li&gt;Initialize a new Node.js project in your directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
&lt;/code&gt;&lt;/pre&gt;



&lt;ol&gt;
&lt;li&gt;Install Playwright by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init playwright@latest
&lt;/code&gt;&lt;/pre&gt;



&lt;ol&gt;
&lt;li&gt;Once Playwright is installed, you can use it with JavaScript or TypeScript for your automation testing. TypeScript is recommended for type safety.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Install fp-ts (Functional Programming in TypeScript)
&lt;/h3&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your CLI or terminal.&lt;/li&gt;
&lt;li&gt;Navigate to your project directory (e.g., my-playwright-project-fp).&lt;/li&gt;
&lt;li&gt;Install fp-ts as a dependency for your project:
&lt;/li&gt;
&lt;/ol&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install fp-ts
&lt;/code&gt;&lt;/pre&gt;



&lt;ol&gt;
&lt;li&gt;You can now start using fp-ts in your TypeScript code. Make sure to import the necessary modules as needed in your TypeScript files.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more on &lt;a href="https://oholsyhevskyi.com/posts/functional-programming-in-automation-testing-partII#common-issues-and-troubleshooting"&gt;https://oholsyhevskyi.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>typescript</category>
      <category>testing</category>
      <category>qa</category>
    </item>
    <item>
      <title>🌟 Functional Programming in Automation Testing with TypeScript and Playwright 🤖🚀 Part I</title>
      <dc:creator>Oleksandr Holyshevskyi</dc:creator>
      <pubDate>Sun, 22 Oct 2023 20:02:02 +0000</pubDate>
      <link>https://dev.to/oholyshevskyi/functional-programming-in-automation-testing-with-typescript-and-playwright-part-i-26m3</link>
      <guid>https://dev.to/oholyshevskyi/functional-programming-in-automation-testing-with-typescript-and-playwright-part-i-26m3</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
Introduction

&lt;ul&gt;
&lt;li&gt;Functional programming in automation testing&lt;/li&gt;
&lt;li&gt;Why TypeScript and Playwright?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Functional programming in automation testing
&lt;/h3&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Functional programming in automation testing is a paradigm that leverages the principles of functional programming to design and write test scripts.&lt;br&gt;
Unlike traditional imperative testing approaches, functional programming focuses on creating test cases as pure functions, emphasizing immutability and composability.&lt;br&gt;
By using technologies like TypeScript and Playwright, testers can build robust, maintainable, and highly readable test frameworks.&lt;br&gt;
This approach offers numerous advantages, including improved code quality, enhanced test coverage, and increased test automation efficiency.&lt;br&gt;
In this post, we will delve deeper into the world of functional programming for automation testing, exploring its benefits and practical implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why TypeScript and Playwright?
&lt;/h3&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using TypeScript and Playwright for creating a test framework holds significant advantages in the context of automation testing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript's Strong Typing:&lt;/strong&gt; TypeScript provides static typing, which means that you catch errors at compile-time rather than runtime. 
This reduces the chances of introducing bugs in your test code and enhances code quality. It also offers code completion and better code documentation, making it easier to write and maintain test scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability&lt;/strong&gt;: TypeScript enforces strict coding standards and best practices, which results in more maintainable code. As automation tests are often long-lived, this is crucial for the longevity of your test framework.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read more on: &lt;a href="https://oholsyhevskyi.com/posts/functional-programming-in-automation-testing-partI#why-typeScript-and-playwright"&gt;https://oholsyhevskyi.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>typescript</category>
      <category>testautomation</category>
    </item>
  </channel>
</rss>
