Column Data Types

Understanding ChartSQL column data types

ChartSQL and SQL Data Types

ChartSQL detects the columns and data types of your SQL queries to determine how to visualize your query. ChartSQL has 4 data types:

  • Date

  • Datetime

  • String

  • Numeric

SQL Data Type Mapping

Every supported SQL database column type is mapped to one of the ChartSQL datatypes automatically. For example, MySQL int, double, and bigint are mapped to numeric while MySQL date is mapped to date

Manual CAST

If your SQL query returns values that you want ChartSQL to detect as a different type, you need to CAST your value in SQL to the appropriate type.

See CAST notes about your particular datasource

Example casting a string in MySQL to a date:

SELECT CAST('2021-01-01' AS DATE);

Last updated

Support

DiscordX

ChartSQL