Skip to content

Tutorials

Welcome to the General SQL Parser tutorials! These learning-oriented guides will teach you how to use GSP through practical, hands-on examples. Each tutorial builds upon the previous one, so we recommend following them in order.

Learning Path

Follow this structured learning path to master General SQL Parser:

graph TD
    A[Getting Started with GSP] --> B[Basic SQL Parsing]
    B --> C[Working with Different Databases]
    C --> D[Advanced Features]

    A --> A1[Setup & Installation]
    A --> A2[First Parse Example]
    A --> A3[Understanding Results]

    B --> B1[Parse Different SQL Types]
    B --> B2[Handle Parse Errors]
    B --> B3[Extract SQL Elements]

    C --> C1[Oracle SQL Parsing]
    C --> C2[SQL Server T-SQL]
    C --> C3[PostgreSQL Extensions]
    C --> C4[MySQL Specifics]

    D --> D1[SQL Transformation]
    D --> D2[Dependency Analysis]
    D --> D3[Custom Visitors]
    D --> D4[Performance Tuning]

Tutorial Overview

1. ๐Ÿš€ Getting Started with GSP

Time: ~30 minutes | Level: Beginner

Learn the fundamentals of General SQL Parser, including setup, basic concepts, and your first parsing examples.

What you'll learn: - How to set up GSP in your project - Core concepts and terminology - Parse your first SQL statement - Understand the parsing results - Handle basic errors

Prerequisites: Basic Java knowledge


2. โšก Basic SQL Parsing

Time: ~45 minutes | Level: Beginner

Master the essentials of SQL parsing with practical examples covering different SQL statement types.

What you'll learn: - Parse SELECT, INSERT, UPDATE, DELETE statements - Extract tables, columns, and conditions - Work with complex queries (JOINs, subqueries) - Handle different SQL statement types - Best practices for parsing

Prerequisites: Complete "Getting Started with GSP"


3. ๐Ÿ—„๏ธ Working with Different Databases

Time: ~60 minutes | Level: Intermediate

Explore GSP's multi-database support and learn how to handle vendor-specific SQL syntax.

What you'll learn: - Configure parser for different database vendors - Handle vendor-specific SQL features - Parse Oracle PL/SQL blocks - Work with SQL Server T-SQL extensions - Handle PostgreSQL and MySQL specifics - Switch between database contexts

Prerequisites: Complete "Basic SQL Parsing"


4. ๐ŸŽฏ Advanced Features

Time: ~90 minutes | Level: Advanced

Unlock the full power of General SQL Parser with advanced features and techniques.

What you'll learn: - SQL transformation and modification - Column lineage and dependency analysis - Custom visitor pattern implementation - Performance optimization techniques - Memory management for large SQL files - Integration with other tools

Prerequisites: Complete all previous tutorials

Tutorial Structure

Each tutorial follows a consistent structure:

Tutorial Format

๐ŸŽฏ Objectives - What you'll achieve by the end

๐Ÿ“‹ Prerequisites - What you need before starting

โฑ๏ธ Time Required - Estimated completion time

๐Ÿ”ง Setup - Environment and project setup

๐Ÿ“ Step-by-Step Guide - Hands-on exercises with explanations

๐Ÿงช Practice Exercises - Additional challenges to reinforce learning

โœ… Summary - Key takeaways and next steps

๐Ÿ”— Related Resources - Links to relevant documentation

Before You Start

Prerequisites

  • Java 8+ installed and configured
  • Maven or Gradle for dependency management
  • IDE (IntelliJ IDEA, Eclipse, or VS Code)
  • Basic understanding of SQL syntax
  • Familiarity with Java programming

Setup

Make sure you have General SQL Parser added to your project:

1
2
3
4
5
<dependency>
    <groupId>com.gudusoft</groupId>
    <artifactId>gsqlparser</artifactId>
    <version>3.3.2</version>
</dependency>
1
implementation 'com.gudusoft:gsqlparser:3.3.2'

Sample Project

We recommend creating a dedicated practice project for these tutorials:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// TutorialExample.java
package com.example.gsptutorial;

import gudusoft.gsqlparser.TGSqlParser;
import gudusoft.gsqlparser.EDbVendor;

public class TutorialExample {
    public static void main(String[] args) {
        System.out.println("GSP Tutorials - Ready to start!");

        // Your tutorial code will go here
    }
}

Learning Tips

Success Tips

๐Ÿ“ Code Along - Don't just read, actually code the examples

๐Ÿ”„ Experiment - Try variations of the provided examples

๐Ÿ› Debug - When something doesn't work, use it as a learning opportunity

๐Ÿ“š Reference - Keep the API documentation handy

โ“ Ask Questions - Use our support channels when stuck

Alternative Learning Paths

Depending on your goals, you might want to take different paths:

Getting Help

If you get stuck during any tutorial:

What's Next?

After completing all tutorials, you'll be ready to:


Ready to start your GSP journey? Begin with Getting Started with GSP ๐Ÿš€