Skip to content

test: add standalone dialect tests and converter edge cases#10

Merged
Coding-Dev-Tools merged 1 commit into
mainfrom
Openclaw/json2sql/add-dialect-tests-and-converter-edge-cases
May 18, 2026
Merged

test: add standalone dialect tests and converter edge cases#10
Coding-Dev-Tools merged 1 commit into
mainfrom
Openclaw/json2sql/add-dialect-tests-and-converter-edge-cases

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner
  • Create tests/test_dialects.py with 48 tests covering:
    • Dialect enum values and membership
    • sql_type_for() for all types across PostgreSQL, MySQL, SQLite
    • quote_identifier() for all dialects (backtick vs double-quote)
    • format_value() edge cases: single quotes, booleans per dialect, None
    • create_table_sql() and insert_sql() including multi-row VALUES
  • Add converter edge case tests to test_converter.py:
    • Unsupported JSON root type (string, number, boolean) -> ValueError
    • generate_schema with flatten=True and nested arrays
    • generate_schema with primitive arrays
    • generate_schema with single object at root

Coverage: 89% -> 96% (230 stmts, 10 uncovered, all optional license paths)

- Create tests/test_dialects.py with 48 tests covering:
  - Dialect enum values and membership
  - sql_type_for() for all types across PostgreSQL, MySQL, SQLite
  - quote_identifier() for all dialects (backtick vs double-quote)
  - format_value() edge cases: single quotes, booleans per dialect, None
  - create_table_sql() and insert_sql() including multi-row VALUES
- Add converter edge case tests to test_converter.py:
  - Unsupported JSON root type (string, number, boolean) -> ValueError
  - generate_schema with flatten=True and nested arrays
  - generate_schema with primitive arrays
  - generate_schema with single object at root

Coverage: 89% -> 96% (230 stmts, 10 uncovered, all optional license paths)
@Coding-Dev-Tools Coding-Dev-Tools merged commit 653e901 into main May 18, 2026
3 checks passed
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.

1 participant