I've attached a patch file and source file for luasql/oracle, this allows dates and timestamps to be returned without using Oracle's TO_DATE sql function.

18 views
Skip to first unread message

David Sheckler

unread,
Apr 17, 2015, 12:47:45 PM4/17/15
to kepler-...@googlegroups.com


I've tested against Oracle 10 on sparc, Oracle 11g on linux and Macosx using both lua 5.1 and 5.2. 

Dates and timestamps, returned from a select, are numeric (milliseconds since epoch) so it's easy to format using os.date("%x %X", row.update_date). It seemed the sensible thing to do but if someone has a better idea, I'm all ears.

Inserts and updates will still need to use the TO_DATE function. I may work on changing that as well, depending on how much it bugs me.

Regards,

David Sheckler.
ls_oci8.c.patch
ls_oci8.c

tomas

unread,
Apr 24, 2015, 10:03:36 AM4/24/15
to kepler-...@googlegroups.com, David Sheckler
Hi David

Thanks for your contribution. Would you mind being the responsible for
this driver? It is currently an orphan! I am still available for
discussion on the topic (from design to implementation details) but I
have no time to spend on other drivers than those that I use.

Regards,
Tomás
> --
> You received this message because you are subscribed to the Google
> Groups "Kepler Developers" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to kepler-projec...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Sheckler

unread,
Apr 24, 2015, 10:28:04 AM4/24/15
to kepler-...@googlegroups.com

Yes, I assumed it was something like that. I've been reading the docs a little more, it appears most people use the mysql or sqlite driver via orbit. I don't think it would take me a lot of work to make it compliant with orbit.

I would also like to replace some deprecated functions, I doubt anyone is using Oracle v7 anymore. As well as add prepared statements. 

So, I'm willing to support it enough to make it work with orbit. My use case is a little more mundane, churning through gobs of XML and loading it into Oracle.

~David 
Reply all
Reply to author
Forward
0 new messages