Are you sure?
DECIMAL in SQL isn’t just for integers, so first if you’re using that type, even just to store integers, consider using an SQL integer-only type (I see in ODBC.jl SQLDECIMAL and SQLINTEGER).
Also consider using a
NOT NULL constraint (defined for a column with e.g.
CREATE TABLE) as much as possible, at least for any kind of numbers.
If not, note that
get "throws a
NullException" at runtime if somehow a
NULL gets into your database, and
convert will throw an
InexactError() in case a fractional value is in the database, as allowed for non-integer SQL types.
Converting to a string (for querying again) will not get you to query for the NULL automatically (see below), but will at least break less helping for fractional values.
I can’t see clearly from the code that
Nullable is only used if you fail to use that constraint. It might be for either case to simplify.
Allowing NULLs is a bitch in SQL because when it happens you usually have to consider a) what to put in its place, say the DEFAULT 0 (you can specify that at least in PostgreSQL database). And b) you might either want to query all the time with (just an example) … WHERE value >= 0 OR value IS NULL