Posted to tcl by aspect at Wed Apr 08 22:00:32 GMT 2015view raw

  1. # I feel like a rubyist!
  2. # this will work after http://core.tcl.tk/tcl/tktview/0f42ff78717
  3. oo::class create tdbconn2 {
  4. method primarykeys {o table} {
  5. set res [next $o $table]
  6. set key [string range $o 1 end]
  7. set schema [my configure -database]
  8. lmap d $res {
  9. if {[dict get $d ${key}Schema] ne $schema} continue
  10. set d
  11. }
  12. }
  13. method foreignkeys {o table} {
  14. set res [next $o $table]
  15. set key [string range $o 1 end]
  16. set schema [my configure -database]
  17. lmap d $res {
  18. if {[dict get $d ${key}Schema] ne $schema} continue
  19. set d
  20. }
  21. }
  22. }
  23. oo::define tdbc::mysql::connection mixin tdbconn2
  24.