Commit e4b0156
committed
Support ROWID-based LOB writes for tables without primary keys
Add ability to write LOB data to tables that don't have a primary key by:
1. Exposing cursor.rowid method in OCI connection wrapper
2. Capturing ROWID after INSERT in exec_insert (@last_insert_rowid)
3. Using ROWID in write_lobs WHERE clause when no PK is available
4. Supporting composite primary keys (Array) in write_lobs
The ROWID approach works because:
- Ruby-oci8's cursor.rowid returns the ROWID of the last inserted row
- ROWID uniquely identifies any row regardless of table structure
- The after_create callback fires immediately after INSERT on same connection
Also includes ORA-01741 diagnostic logging for empty column detection.1 parent e834b46 commit e4b0156
File tree
2 files changed
+35
-5
lines changed- lib/active_record/connection_adapters/oracle_enhanced
2 files changed
+35
-5
lines changedLines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
| |||
280 | 287 | | |
281 | 288 | | |
282 | 289 | | |
283 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
284 | 306 | | |
285 | 307 | | |
286 | 308 | | |
| |||
289 | 311 | | |
290 | 312 | | |
291 | 313 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
296 | 317 | | |
297 | 318 | | |
298 | 319 | | |
299 | 320 | | |
300 | 321 | | |
301 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
302 | 326 | | |
303 | 327 | | |
304 | 328 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| |||
0 commit comments