dotConnect for Google BigQuery Documentation
On this page
    Entity Framework Core Data Type Mapping
    On this page

    dotConnect for Google BigQuery supports Entity Framework Core 3, 8, 9, 10, and 11.

    BigQuery to .NET Type Mapping

    The following table shows the type mappings used when you generate a model from an existing dataset by running Scaffold-DbContext in Package Manager Console or dotnet ef dbcontext scaffold in the .NET CLI.

    BigQuery Data Type

    Store Type in the Model

    .NET

    INT64 (INT, SMALLINT, INTEGER, BIGINT, TINYINT, BYTEINT)INT64System.Int64
    FLOAT64FLOAT64System.Double
    NUMERIC (DECIMAL)NUMERIC, NUMERIC(p, s)System.Decimal
    BIGNUMERIC (BIGDECIMAL)BIGNUMERIC, BIGNUMERIC(p, s)System.Decimal
    BOOLBOOLSystem.Boolean
    STRINGSTRING, STRING(n)System.String
    BYTESBYTES, BYTES(n)System.Byte[]
    DATEDATESystem.DateTime
    TIMETIMESystem.TimeSpan
    DATETIMEDATETIMESystem.DateTime
    TIMESTAMPTIMESTAMPSystem.DateTimeOffset
    JSONJSONSystem.String
    GEOGRAPHYGEOGRAPHYSystem.String
    INTERVALINTERVALSystem.String
    RANGE<DATE | DATETIME | TIMESTAMP>RANGE<DATE>, RANGE<DATETIME>, RANGE<TIMESTAMP>System.String

    .NET to BigQuery Type Mapping

    The following table shows the type mappings used when you create a database from a model through Code First, migrations, or EnsureCreated, and when you use parameters and literals in queries.

    .NET

    BigQuery Data Type

    System.Int64, System.Int32, System.Int16, System.Byte, System.SByteINT64
    System.Double, System.SingleFLOAT64
    System.DecimalNUMERIC; NUMERIC(p, s) if precision and scale are specified
    System.BooleanBOOL
    System.StringSTRING; STRING(n) if the maximum length is specified
    System.Byte[]BYTES
    System.GuidSTRING (the value is stored as text)
    System.DateTimeDATETIME
    System.DateTimeOffsetTIMESTAMP
    System.TimeSpanTIME
    System.DateOnly1DATE
    System.TimeOnly1TIME

    1 Entity Framework Core 8 and later.

    Notes