CodeIgniter Forums
Support for spatial data types and functions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Support for spatial data types and functions (/showthread.php?tid=82161)



Support for spatial data types and functions - atsanna - 06-19-2022

I would like to add support for spatial data types and functions. Is it possible to extend the classes in the system / database folder and create a composer package? From my tests it doesn't seem possible ...


RE: Support for spatial data types and functions - MGatner - 06-19-2022

Last I heard there was not a meaningful way to *replace* a database driver with your own, but you can easily define your own driver as an extension of the existing one(s) and add whatever you want to it. Then in your database Config just select the new driver:

'DBDriver' => 'SpatialMySQL'

Also check out @kenjis Pull Request for RawSql support because it is possible that will allow you to do spatial handling without a separate driver.


RE: Support for spatial data types and functions - atsanna - 06-19-2022

(06-19-2022, 03:31 AM)MGatner Wrote: Last I heard there was not a meaningful way to *replace* a database driver with your own, but you can easily define your own driver as an extension of the existing one(s) and add whatever you want to it. Then in your database Config just select the new driver:

'DBDriver' => 'SpatialMySQL'

Also check out @kenjis Pull Request for RawSql support because it is possible that will allow you to do spatial handling without a separate driver.

Obviously my approach was wrong. Thank you very much: I will work following your advice.