Skip to content

DBCode incorrectly treats unspecified column nullability as NOT NULL in Fabric Warehouse #1173

Description

@WesleyDieterich

Bug Description

When creating a table without explicitly specifying NULL or NOT NULL for columns, DBCode appears to treat the columns as NOT NULL by default. This behavior differs from SQL Server-compatible engines (such as Fabric Warehouse), where columns allow NULL by default if not specified.

As a result, insert operations that should be valid fail with nullability errors.

Repro steps

  1. Open a SQL query editor connected to a SQL Server-Fabric Warehouse database

  2. Run the following script:

    CREATE TABLE #Test (
        ID INT
    );
    
    INSERT INTO #Test VALUES (NULL);
    
  3. Execute the script using DBCode

  4. Observe the error raised during the INSERT

Expected Behavior

Columns without explicit nullability definition should default to allowing NULL, matching SQL Server / Fabric Warehouse behavior. The INSERT statement should execute successfully.

Actual Behavior

DBCode treats the column as NOT NULL, causing the following error during INSERT:
"Cannot insert the value NULL into column 'ID', table 'tempdb.dbo.#Test'; column does not allow nulls. INSERT fails."

Environment

  • DBCode version: 1.35.9
  • VS Code (or fork) version: 1.127.0
  • OS: CachyOS and Windows 11
  • Database: Fabric Warehouse
  • Connection: Direct (SQL endpoint)

Error Meesages (if applicable)

Cannot insert the value NULL into column 'ID', table 'tempdb.dbo.#Test'; column does not allow nulls. INSERT fails.

Screenshots

DBCode:
Image

Fabric Warehouse Editor:
Image

Logs

CREATE TABLE #Test (
    ID INT
);

INSERT INTO #Test VALUES (NULL);
Cannot insert the value NULL into column 'ID', table 'tempdb.dbo.#Test_______________________________________________________________________________________________________________0000000000FF'; column does not allow nulls. INSERT fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions