[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MySQL/MariaDB Boolean Type
From: |
Nala Ginrut |
Subject: |
Re: MySQL/MariaDB Boolean Type |
Date: |
Sat, 11 Mar 2023 03:00:37 +0800 |
User-agent: |
mu4e 1.4.15; emacs 27.1 |
Hi Jaft!
Aratnis had abstracted boolean type in mvc/model.scm
--------------------code----------------
(define *db-specific-types*
'((mysql
(text . longtext)
(boolean . boolean))
(postgresql
(text . text)
(boolean . boolean))
(sqlite3
(text . text)
(boolean . integer))))
---------------------end-----------------
You may use `boolean' to define a table in a model, for example:
-----------------code---------------
(create-table
'user
'(id auto (#:primary-key))
'(name char-field (#:not-null #:maxlen 128))
'(is_admin boolean (#:not-null))
'(last_login bigint (#:unsigned #:not-null)))
------------------end------------------
I'm sorry I haven't put it in the document, I'll introduce it in the
recent release.
Best regards.
Jaft writes:
> I think I always meant to ask but keep forgetting to – what would you think,
> Nala, of providing a boolean type?
> Both MySQL and MariaDB abstract this type for the user, already, so doing the
> same at the Artanis layer wouldn't be terribly different than the DB
> converting boolean values to 1 and 0, right?
> And it'd make working with those values easier to read when reading the code
> of a project, for the first time.
--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058
signature.asc
Description: PGP signature