Skip to content

Add DESCRIBE TABLE SQL command support#18

Open
hoangsonww wants to merge 1 commit intomasterfrom
codex/add-new-feature-for-dbms-system
Open

Add DESCRIBE TABLE SQL command support#18
hoangsonww wants to merge 1 commit intomasterfrom
codex/add-new-feature-for-dbms-system

Conversation

@hoangsonww
Copy link
Copy Markdown
Owner

@hoangsonww hoangsonww commented Sep 26, 2025

This pull request introduces support for the standard SQL DESCRIBE (and DESC) command, allowing users to view column metadata for tables directly from the SQL workflow. The changes span parser, engine, and documentation updates to provide a seamless introspection experience.

SQL Introspection Feature:

  • Added parsing support for DESCRIBE and DESC statements in the SQL parser, including a new DescribeTableQuery type and corresponding logic to extract the table name. (src/query/sql_parser.cpp, src/query/sql_parser.h) [1] [2] [3] [4]
  • Updated the query execution engine to handle DESCRIBE_TABLE queries, returning detailed column metadata such as name, type, nullability, and default value. (src/engine/database_engine.cpp)
  • Introduced a utility function to convert internal value types to human-readable SQL type strings for output formatting. (src/types/value.cpp, src/types/value.h) [1] [2]

User Experience Improvements:

  • Enhanced CLI help output to include DESCRIBE [TABLE] as a supported command. (cli_main.cpp)
  • Updated documentation to announce the new DESCRIBE feature and provide usage guidance for users. (README.md)

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lattice-db-next-gen-dbms Ready Ready Preview Comment Sep 26, 2025 11:46pm

@hoangsonww hoangsonww added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 26, 2025
@hoangsonww hoangsonww added this to the v2.3.0 milestone Sep 26, 2025
@hoangsonww hoangsonww requested a review from Copilot September 26, 2025 23:46
@hoangsonww hoangsonww self-assigned this Sep 26, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds DESCRIBE TABLE SQL command support to enable schema introspection. It implements full parsing, execution, and documentation for the DESCRIBE/DESC commands to show table metadata.

  • Adds new value_type_to_string helper function for consistent type formatting
  • Implements DESCRIBE/DESC SQL parsing and execution with proper error handling
  • Updates CLI help and README documentation to include the new functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types/value.h Adds declaration for value_type_to_string helper function
src/types/value.cpp Implements value_type_to_string with switch statement for all ValueType cases
src/query/sql_parser.h Adds DESCRIBE_TABLE query type and DescribeTableQuery struct
src/query/sql_parser.cpp Implements DESCRIBE/DESC parsing with optional TABLE keyword support
src/engine/database_engine.cpp Implements DESCRIBE query execution returning formatted schema information
cli_main.cpp Updates CLI help text to include DESCRIBE command
README.md Documents new DESCRIBE functionality with usage notes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/types/value.cpp
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hoangsonww
Copy link
Copy Markdown
Owner Author

This pull request introduces support for the standard SQL DESCRIBE (or DESC) command, allowing users to view table schema metadata directly from the CLI. The implementation includes parser and engine changes, as well as user-facing documentation and CLI help updates.

SQL Introspection Feature:

  • Added support for parsing and executing DESCRIBE table_name; and DESC table_name; commands, enabling users to inspect table columns, types, nullability, and default values. (src/query/sql_parser.cpp, src/query/sql_parser.h, src/engine/database_engine.cpp) [1] [2] [3] [4] [5] [6] [7]

  • Implemented a helper function value_type_to_string to convert internal column types to human-readable strings for display in the DESCRIBE output. (src/types/value.cpp, src/types/value.h) [1] [2]

CLI and Documentation Updates:

  • Updated CLI help output to include DESCRIBE [TABLE] as a supported command. (cli_main.cpp)
  • Added a note to the README.md highlighting the new SQL introspection feature for user awareness. (README.md)

@hoangsonww hoangsonww added the question Further information is requested label Sep 27, 2025
@hoangsonww hoangsonww moved this from Backlog to Ready in LatticeDBMS Kanban Board Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Projects

Status: Ready

2 participants