Using MySQL functions when editing data

168 views
Skip to first unread message

Luke Arms

unread,
Dec 11, 2011, 7:04:46 AM12/11/11
to Sequel Pro
Is there any way to tell Sequel Pro not to quote text that looks like
a MySQL function when editing a non-text field?

For example, when I'm adding a row to a table with an added_time field
(datetime), I'd like to simply enter "utc_timestamp()" in Sequel Pro's
"spreadsheet" editor, and have it actually work. Is there a way to do
this already?

Thanks heaps. Awesome tool, BTW :)

Larry Spencer

unread,
Dec 17, 2011, 5:57:24 PM12/17/11
to Sequel Pro
I took the cheap way out and used an external abbreviation expander
tool. I use "TypeIt4Me" on the Mac, so I just defined the
abbreviation "sqltime" to mean "%Y-%m-%d %H:%M:%S", which gives me the
current time in SQL's favorite format.

HansJB

unread,
Dec 19, 2011, 7:54:45 AM12/19/11
to Sequel Pro
Hi,

it is also possible to write your own script (Bundle command) which
will transform/convert your data entered into the desired format.
These commands (written in any scripting language incl. BASH) are
available inside each text input cell's context menu or via main menu
> Bundles > Input Fields. As examples you will find the commands SHA1
and MD5 in the Bundle Editor.

Best,
--Hans

PS the BASH command for utc_timestamp() is:
date -u "+%Y-%m-%d %H:%M:%S"

Reply all
Reply to author
Forward
0 new messages