Skip to content

Conversation

@quinnj
Copy link
Member

@quinnj quinnj commented Jan 14, 2026

Summary

Fixes #225 - Allows overriding default SQL types when creating tables via MySQL.load().

  • Add coltypes keyword argument to MySQL.load() that accepts a Dict mapping column names (as Symbols) to SQL type strings
  • For example, users can now use LONGBLOB instead of BLOB for large binary data:
    MySQL.load(data, conn, "mytable"; coltypes=Dict(:photo => "LONGBLOB"))

Changes

  • Add sqltype(T, coltypes, name) method to check coltypes dict first before falling back to default type mapping
  • Pass coltypes through createtable() function
  • Update docstring with documentation for the new parameter

Test plan

  • Add test for coltypes override with LONGBLOB
  • Verify column is created with correct type via SHOW COLUMNS
  • Verify data roundtrips correctly

🤖 Generated with Claude Code

quinnj and others added 2 commits January 13, 2026 23:47
Fixes #225 - Allows overriding default SQL types when creating tables
via MySQL.load(). For example, users can now use LONGBLOB instead of
BLOB for large binary data:

    MySQL.load(data, conn, "mytable"; coltypes=Dict(:photo => "LONGBLOB"))

Changes:
- Add sqltype(T, coltypes, name) method to check coltypes dict first
- Pass coltypes through createtable() function
- Add test for coltypes override with LONGBLOB

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The SHOW COLUMNS query returns the Type column as Vector{UInt8}
(binary) rather than String. Convert to String before comparison.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.21%. Comparing base (cf5ce4f) to head (a5a01c1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   63.17%   63.21%   +0.03%     
==========================================
  Files           9        9              
  Lines        1108     1109       +1     
==========================================
+ Hits          700      701       +1     
  Misses        408      408              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quinnj quinnj merged commit 49a062f into main Jan 14, 2026
6 checks passed
@quinnj quinnj deleted the jq/coltypes-longblob branch January 14, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Honoring LONGBLOB column type

2 participants