sequel-duckdb 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -20
  3. data/lib/sequel/duckdb/version.rb +1 -4
  4. metadata +3 -59
  5. data/.beads/.beads-credential-key +0 -1
  6. data/.beads/.gitignore +0 -66
  7. data/.beads/README.md +0 -85
  8. data/.beads/config.yaml +0 -56
  9. data/.beads/hooks/post-checkout +0 -24
  10. data/.beads/hooks/post-merge +0 -24
  11. data/.beads/hooks/pre-commit +0 -24
  12. data/.beads/hooks/pre-push +0 -24
  13. data/.beads/hooks/prepare-commit-msg +0 -24
  14. data/.beads/metadata.json +0 -7
  15. data/.kiro/specs/advanced-sql-features-implementation/design.md +0 -26
  16. data/.kiro/specs/advanced-sql-features-implementation/requirements.md +0 -43
  17. data/.kiro/specs/advanced-sql-features-implementation/tasks.md +0 -28
  18. data/.kiro/specs/duckdb-sql-syntax-compatibility/design.md +0 -272
  19. data/.kiro/specs/duckdb-sql-syntax-compatibility/requirements.md +0 -84
  20. data/.kiro/specs/duckdb-sql-syntax-compatibility/tasks.md +0 -107
  21. data/.kiro/specs/edge-cases-and-validation-fixes/requirements.md +0 -32
  22. data/.kiro/specs/integration-test-database-setup/design.md +0 -0
  23. data/.kiro/specs/integration-test-database-setup/requirements.md +0 -117
  24. data/.kiro/specs/sequel-duckdb-adapter/design.md +0 -549
  25. data/.kiro/specs/sequel-duckdb-adapter/requirements.md +0 -202
  26. data/.kiro/specs/sequel-duckdb-adapter/tasks.md +0 -292
  27. data/.kiro/specs/sql-expression-handling-fix/design.md +0 -331
  28. data/.kiro/specs/sql-expression-handling-fix/requirements.md +0 -86
  29. data/.kiro/specs/sql-expression-handling-fix/tasks.md +0 -25
  30. data/.kiro/specs/test-infrastructure-improvements/requirements.md +0 -106
  31. data/.kiro/steering/product.md +0 -26
  32. data/.kiro/steering/structure.md +0 -88
  33. data/.kiro/steering/tech.md +0 -137
  34. data/.kiro/steering/testing.md +0 -213
  35. data/.mdformat.toml +0 -2
  36. data/.release-please-manifest.json +0 -3
  37. data/.rubocop.yml +0 -161
  38. data/.rubocop_todo.yml +0 -323
  39. data/.yardopts +0 -8
  40. data/AGENTS.md +0 -154
  41. data/API_DOCUMENTATION.md +0 -943
  42. data/FINAL_STATUS.md +0 -99
  43. data/MIGRATION_EXAMPLES.md +0 -740
  44. data/PERFORMANCE_OPTIMIZATIONS.md +0 -726
  45. data/REFACTORING_SUMMARY.md +0 -264
  46. data/Rakefile +0 -43
  47. data/TASK_10.2_IMPLEMENTATION_SUMMARY.md +0 -182
  48. data/docs/DUCKDB_SQL_PATTERNS.md +0 -448
  49. data/docs/TASK_12_VERIFICATION_SUMMARY.md +0 -135
  50. data/justfile +0 -52
  51. data/plans/date_arithmetic.md +0 -420
  52. data/plans/engineering/Sequel.md +0 -471
  53. data/plans/engineering/duckdb.md +0 -712
  54. data/plans/engineering/sqlite.md +0 -453
  55. data/plans/mock_connection_bug.md +0 -333
  56. data/plans/mock_without_driver_gem.md +0 -371
  57. data/plans/over_engineering_analysis.md +0 -122
  58. data/plans/schema_management.md +0 -383
  59. data/release-please-config.json +0 -14
  60. data/sig/sequel/duckdb.rbs +0 -6
@@ -1,137 +0,0 @@
1
- # Technology Stack
2
-
3
- ## Language & Runtime
4
-
5
- - **Ruby**: 3.1+ required
6
- - **Gem**: Standard Ruby gem structure
7
-
8
- ## Dependencies
9
-
10
- - **Sequel**: Database toolkit (core dependency)
11
- - **duckdb**: Official DuckDB client gem for connections
12
- - **DuckDB**: Target database system
13
- - **Bundler**: Dependency management
14
- - **Rake**: Build automation
15
- - **RuboCop**: Code linting and style enforcement
16
-
17
- ## Testing Framework
18
-
19
- - **Minitest**: Ruby's built-in testing framework (following sequel-hexspace pattern)
20
- - **Sequel Mock Database**: For SQL generation testing without database connections
21
- - **DuckDB In-Memory**: For integration testing with actual database instances
22
-
23
- ## Development Tools
24
-
25
- - **IRB**: Interactive Ruby console
26
- - **Git**: Version control
27
- - **GitHub Actions**: CI/CD (configured)
28
-
29
- ## Code Style & Quality
30
-
31
- - **RuboCop** configuration enforces:
32
- - Double quotes for string literals
33
- - Ruby 3.1 target version
34
- - Standard Ruby style guidelines
35
-
36
- ## Common Commands
37
-
38
- ### Setup & Installation
39
-
40
- ```bash
41
- # Install dependencies
42
- bundle install
43
-
44
- # Setup development environment
45
- bin/setup
46
-
47
- # Interactive console
48
- bin/console
49
- ```
50
-
51
- ### Development Workflow
52
-
53
- ```bash
54
- # Run tests (primary development command)
55
- bundle exec rake test
56
- # or
57
- ruby test/all.rb
58
-
59
- # Run linting
60
- bundle exec rake rubocop
61
- # or simply
62
- rake
63
-
64
- # Run both tests and linting
65
- bundle exec rake
66
-
67
- # Install gem locally
68
- bundle exec rake install
69
-
70
- # Build gem
71
- bundle exec rake build
72
-
73
- # Release new version
74
- bundle exec rake release
75
- ```
76
-
77
- ### Testing Commands
78
-
79
- ```bash
80
- # Run all tests
81
- ruby test/all.rb
82
-
83
- # Run specific test file
84
- ruby test/database_test.rb
85
-
86
- # Run tests with verbose output
87
- ruby test/all.rb -v
88
-
89
- # Run specific test method
90
- ruby test/database_test.rb -n test_connection
91
- ```
92
-
93
- ### Code Quality
94
-
95
- ```bash
96
- # Run RuboCop with auto-correct
97
- bundle exec rubocop -a
98
-
99
- # Check specific files
100
- bundle exec rubocop lib/
101
- ```
102
-
103
- ## Coding Standards & References
104
-
105
- ### Primary Code Style Reference (in order of precedence)
106
-
107
- 1. **jeremyevans/sequel**: Official Sequel repository - follow all conventions and idioms
108
- 2. **sequel-hexspace**: Secondary reference for adapter patterns
109
- 3. **sequel_impala**: Additional reference for implementation approaches
110
-
111
- ### Implementation Guidelines
112
-
113
- - Study git history of reference projects to understand implementation order
114
- - Focus on incremental, testable implementations
115
- - **ALWAYS write tests BEFORE implementing functionality (TDD)**
116
- - Follow Test-Driven Development (TDD) approach strictly
117
- - All SQL generation must have corresponding tests
118
- - Every public method must have test coverage
119
- - Integration tests must use actual DuckDB instances
120
- - Unit tests must use Sequel's mock database for SQL generation testing
121
-
122
- ### Testing Requirements (MANDATORY)
123
-
124
- - **Test Structure**: Follow sequel-hexspace test organization exactly
125
- - **Test Files**: Mirror sequel-hexspace test files (database_test.rb, dataset_test.rb, schema_test.rb, etc.)
126
- - **SQL Generation Tests**: Every SQL generation method must have unit tests verifying correct SQL output
127
- - **Integration Tests**: Database operations must have tests using actual DuckDB databases
128
- - **Error Handling Tests**: All error conditions must have corresponding test coverage
129
- - **Type Conversion Tests**: All data type mappings must be thoroughly tested
130
- - **Mock Database Tests**: Use Sequel's mock database for testing SQL generation without database connections
131
- - **Test Coverage**: Aim for 100% test coverage of all implemented functionality
132
-
133
- ### Connection Management
134
-
135
- - Use **duckdb** gem exclusively for database connections
136
- - Follow Sequel's connection pooling patterns
137
- - Implement proper error handling and connection lifecycle management
@@ -1,213 +0,0 @@
1
- # Testing Requirements and Standards
2
-
3
- ## CRITICAL RULE: Test-Driven Development (TDD) is MANDATORY
4
-
5
- **Every single piece of code implementation must follow strict Test-Driven Development:**
6
-
7
- 1. **Write Tests FIRST** - Before writing any implementation code, comprehensive tests must be written
8
- 2. **Red-Green-Refactor** - Follow the TDD cycle: failing test → minimal implementation → refactor
9
- 3. **No Code Without Tests** - Implementation without corresponding tests is not acceptable
10
- 4. **100% Test Coverage** - All implemented functionality must have test coverage
11
-
12
- ## Test Structure (Following sequel-hexspace Pattern)
13
-
14
- ### Required Test Files
15
-
16
- ```
17
- test/
18
- ├── all.rb # Test runner - loads all test files
19
- ├── spec_helper.rb # Test configuration, setup, and shared utilities
20
- ├── database_test.rb # Database connection, transactions, and basic functionality
21
- ├── dataset_test.rb # Comprehensive SQL generation and query execution tests
22
- ├── schema_test.rb # Schema operations, introspection, and DDL tests
23
- ├── prepared_statement_test.rb # Prepared statement functionality and parameter binding
24
- ├── sql_test.rb # SQL generation syntax and correctness tests
25
- └── type_test.rb # Data type handling, conversion, and mapping tests
26
- ```
27
-
28
- ### Test Categories
29
-
30
- #### 1. SQL Generation Tests (Unit Tests)
31
-
32
- - **Purpose**: Test SQL generation without database connections
33
- - **Tool**: Use Sequel's mock database functionality
34
- - **Requirements**:
35
- - Every SQL generation method must have tests
36
- - Verify correct SQL syntax and structure
37
- - Test edge cases and parameter handling
38
- - Must be fast and isolated
39
- - Test all SQL operations: SELECT, INSERT, UPDATE, DELETE, DDL
40
-
41
- #### 2. Integration Tests
42
-
43
- - **Purpose**: Test actual database operations
44
- - **Tool**: Use real DuckDB in-memory databases
45
- - **Requirements**:
46
- - Test actual database operations end-to-end
47
- - Verify data persistence and retrieval
48
- - Test connection management and lifecycle
49
- - Test transaction behavior (commit, rollback)
50
- - Test error handling with real database errors
51
-
52
- #### 3. Schema Tests
53
-
54
- - **Purpose**: Test schema operations and introspection
55
- - **Requirements**:
56
- - Test table creation, modification, and deletion
57
- - Test index operations
58
- - Test schema introspection accuracy
59
- - Test constraint handling
60
- - Test DuckDB-specific schema features
61
-
62
- #### 4. Type Conversion Tests
63
-
64
- - **Purpose**: Test Ruby ↔ DuckDB type mapping
65
- - **Requirements**:
66
- - Test all supported data types
67
- - Test edge cases and null handling
68
- - Test precision and scale for numeric types
69
- - Test date/time handling and timezone considerations
70
- - Test binary data and text encoding
71
-
72
- #### 5. Error Handling Tests
73
-
74
- - **Purpose**: Test proper exception mapping and error scenarios
75
- - **Requirements**:
76
- - Test Sequel exception mapping
77
- - Test connection failure scenarios
78
- - Test SQL syntax error handling
79
- - Test constraint violation handling
80
- - Test timeout and resource limit scenarios
81
-
82
- ## Implementation Workflow
83
-
84
- ### For Every Task Involving Code:
85
-
86
- 1. **Step 1: Write Tests First**
87
-
88
- - Create comprehensive test cases covering the functionality
89
- - Include both positive and negative test cases
90
- - Test edge cases and error conditions
91
- - Ensure tests fail initially (Red phase)
92
-
93
- 2. **Step 2: Minimal Implementation**
94
-
95
- - Write the minimal code needed to make tests pass
96
- - Focus on making tests green, not on perfect implementation
97
- - Avoid over-engineering at this stage
98
-
99
- 3. **Step 3: Refactor**
100
-
101
- - Improve code quality while keeping tests green
102
- - Optimize performance if needed
103
- - Ensure code follows style guidelines
104
-
105
- 4. **Step 4: Verify Coverage**
106
-
107
- - Ensure all implemented functionality has test coverage
108
- - Add additional tests if gaps are found
109
-
110
- ## Test Quality Standards
111
-
112
- ### Test Code Quality
113
-
114
- - Tests must be clear and readable
115
- - Test names should describe what is being tested
116
- - Tests should be independent and isolated
117
- - Tests should be deterministic (no flaky tests)
118
- - Tests should run quickly (especially unit tests)
119
-
120
- ### Test Coverage Requirements
121
-
122
- - **100% line coverage** for all implemented functionality
123
- - **Branch coverage** for all conditional logic
124
- - **Edge case coverage** for error conditions
125
- - **Integration coverage** for database operations
126
-
127
- ### Test Documentation
128
-
129
- - Each test file should have a header explaining its purpose
130
- - Complex test setups should be documented
131
- - Test utilities should be well-documented
132
- - Tests serve as executable documentation
133
-
134
- ## Tools and Utilities
135
-
136
- ### Mock Database Testing
137
-
138
- ```ruby
139
- # Example of mock database testing for SQL generation
140
- DB = Sequel.mock
141
- dataset = DB[:users].where(name: 'John')
142
- assert_equal "SELECT * FROM users WHERE (name = 'John')", dataset.sql
143
- ```
144
-
145
- ### Integration Testing Setup
146
-
147
- ```ruby
148
- # Example of integration testing with real DuckDB
149
- def setup
150
- @db = Sequel.connect("duckdb::memory:")
151
- @db.create_table(:test_table) do
152
- primary_key :id
153
- String :name
154
- end
155
- end
156
- ```
157
-
158
- ## Continuous Integration
159
-
160
- ### Test Execution
161
-
162
- - All tests must pass before any code is merged
163
- - Tests should be run on multiple Ruby versions
164
- - Tests should be run on different operating systems
165
- - Performance regression tests should be included
166
-
167
- ### Test Reporting
168
-
169
- - Test results should be clearly reported
170
- - Coverage reports should be generated
171
- - Failed tests should provide clear error messages
172
- - Test execution time should be monitored
173
-
174
- ## Common Testing Patterns
175
-
176
- ### Testing SQL Generation
177
-
178
- ```ruby
179
- def test_select_with_where
180
- dataset = @db[:users].where(name: 'John')
181
- assert_equal "SELECT * FROM users WHERE (name = 'John')", dataset.sql
182
- end
183
- ```
184
-
185
- ### Testing Database Operations
186
-
187
- ```ruby
188
- def test_insert_and_select
189
- @db[:users].insert(name: 'John', email: 'john@example.com')
190
- user = @db[:users].where(name: 'John').first
191
- assert_equal 'john@example.com', user[:email]
192
- end
193
- ```
194
-
195
- ### Testing Error Conditions
196
-
197
- ```ruby
198
- def test_connection_error
199
- assert_raises(Sequel::DatabaseConnectionError) do
200
- Sequel.connect("duckdb:/invalid/path/database.db")
201
- end
202
- end
203
- ```
204
-
205
- ## Remember: NO CODE WITHOUT TESTS
206
-
207
- This is not optional. Every implementation task must begin with writing comprehensive tests. This ensures:
208
-
209
- - Functionality works as expected
210
- - Regressions are caught early
211
- - Code is maintainable and refactorable
212
- - Documentation through executable examples
213
- - Confidence in the codebase
data/.mdformat.toml DELETED
@@ -1,2 +0,0 @@
1
- extensions = ["frontmatter", "gfm"]
2
- number = true
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.2.0"
3
- }
data/.rubocop.yml DELETED
@@ -1,161 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- plugins:
4
- - rubocop-minitest
5
- - rubocop-rake
6
- - rubocop-sequel
7
-
8
- AllCops:
9
- TargetRubyVersion: 4.0
10
- NewCops: enable
11
- SuggestExtensions: false
12
- Exclude:
13
- - 'vendor/**/*'
14
- - 'bin/**/*'
15
- - 'tmp/**/*'
16
-
17
- inherit_mode:
18
- merge:
19
- - Exclude
20
-
21
- Layout/IndentationWidth:
22
- Width: 2
23
-
24
- Style/StringLiterals:
25
- EnforcedStyle: double_quotes
26
-
27
- Style/StringLiteralsInInterpolation:
28
- EnforcedStyle: double_quotes
29
-
30
- Style/DefWithParentheses:
31
- Enabled: false
32
-
33
- Style/MethodCallWithoutArgsParentheses:
34
- Enabled: true
35
-
36
- Layout/LineLength:
37
- Max: 120
38
- AllowedPatterns: ['\A\s*#']
39
- Exclude:
40
- - '*.gemspec'
41
- - 'test/**/*'
42
-
43
- Style/Documentation:
44
- Enabled: false
45
-
46
- Style/FrozenStringLiteralComment:
47
- Enabled: false
48
-
49
- Style/Lambda:
50
- Enabled: false
51
-
52
- Style/ParallelAssignment:
53
- Enabled: false
54
-
55
- Style/GuardClause:
56
- Enabled: true
57
-
58
- Style/IfUnlessModifier:
59
- Enabled: true
60
-
61
- Metrics/MethodLength:
62
- Max: 25
63
-
64
- Metrics/ClassLength:
65
- Max: 200
66
-
67
- Metrics/ModuleLength:
68
- Max: 200
69
-
70
- Metrics/BlockLength:
71
- Max: 50
72
- Exclude:
73
- - 'test/**/*'
74
- - '*.gemspec'
75
- - 'Rakefile'
76
-
77
- Style/ZeroLengthPredicate:
78
- Enabled: false
79
-
80
- Naming/MemoizedInstanceVariableName:
81
- Enabled: false
82
-
83
- Naming/MethodParameterName:
84
- MinNameLength: 1
85
-
86
- Style/MultilineBlockChain:
87
- Enabled: false
88
-
89
- Metrics/AbcSize:
90
- Max: 35
91
- Exclude:
92
- - 'test/**/*'
93
-
94
- Metrics/CyclomaticComplexity:
95
- Max: 15
96
-
97
- Metrics/PerceivedComplexity:
98
- Max: 12
99
-
100
- Metrics/BlockNesting:
101
- Max: 4
102
-
103
- Naming/AccessorMethodName:
104
- Enabled: false
105
-
106
- Style/HashSyntax:
107
- EnforcedStyle: ruby19
108
- EnforcedShorthandSyntax: either
109
-
110
- Minitest/AssertEqual:
111
- Enabled: true
112
-
113
- Minitest/RefuteEqual:
114
- Enabled: true
115
-
116
- Minitest/MultipleAssertions:
117
- Enabled: false
118
-
119
- Layout/EmptyLinesAroundClassBody:
120
- EnforcedStyle: empty_lines_except_namespace
121
-
122
- Layout/EmptyLinesAroundModuleBody:
123
- EnforcedStyle: empty_lines_except_namespace
124
-
125
- Style/TrailingCommaInArguments:
126
- EnforcedStyleForMultiline: comma
127
-
128
- Style/TrailingCommaInArrayLiteral:
129
- EnforcedStyleForMultiline: comma
130
-
131
- Style/TrailingCommaInHashLiteral:
132
- EnforcedStyleForMultiline: comma
133
-
134
- Gemspec/DevelopmentDependencies:
135
- Enabled: false
136
-
137
- Style/HashLikeCase:
138
- Exclude:
139
- - 'test/**/*'
140
-
141
- Lint/DuplicateBranch:
142
- Exclude:
143
- - 'test/**/*'
144
-
145
- Style/StringConcatenation:
146
- Exclude:
147
- - 'test/**/*'
148
-
149
- Naming/VariableNumber:
150
- Exclude:
151
- - 'test/**/*'
152
-
153
- Lint/EmptyBlock:
154
- Exclude:
155
- - 'test/**/*'
156
-
157
- Style/TrivialAccessors:
158
- Enabled: true
159
-
160
- Lint/DuplicateMethods:
161
- Enabled: true