Skip to content

Declarative schema definition

budu edited this page Jan 21, 2011 · 1 revision

Declarative Schema Definition

Idea

Say we are working on a database built from the following schema:

(defschema sample-schema :lobos
  (table :users
    (varchar :name 100 :unique)
    (check :name (> :length/name 1)))
...

Instead of imperatively issuing alter statements, wouldn't it be great to just change it?

(defschema sample-schema :lobos
  (table :users
    (varchar :name 100 :unique)
    (text :bio)
    (check :name (> :length/name 1)))
...

Clone this wiki locally