SQL Analysis

Learn how the editor automatically analyzes SQL for statement separation and table recognition.

Auto SQL Statement Extraction

When multiple SQL statements are written in the editor, NeoSQL automatically splits them by semicolons (;).

Splitting rules:

  • Statements are split by semicolons (;)
  • Semicolons inside string literals ('...', "...") are ignored
  • Semicolons inside comments (-- ..., /* ... */) are ignored

Cursor-based extraction during EXECUTE:

  • Cursor inside a SQL statement → that statement is the execution target
  • Cursor on an empty line → the nearest SQL statement above is the execution target

This behavior allows you to write multiple SQL statements in a single editor and selectively execute specific ones by moving the cursor.

Auto Table Extraction from SQL

As you write SQL, NeoSQL automatically recognizes referenced table names. This information is used for the following features:

FeatureDescription
AutocompleteColumns from tables used in FROM/JOIN clauses are prioritized in the autocomplete list.
Alias RecognitionWhen you alias a table like FROM users u, typing u. suggests columns from the users table.
FK ReferenceIdentifies FK columns in the result grid and provides row lookup functionality.
Inline EditDetermines whether it's a single-table query to decide if edit mode can be activated.

Recognized table reference locations:

  • FROM clause
  • JOIN clause (INNER, LEFT, RIGHT, FULL, CROSS)
  • INSERT INTO target table
  • UPDATE target table
  • WITH (CTE) subqueries