db_types.anubis 1.04 KB
/*
 * Created by PyramIDE.
 * User: Totoro
 * Date: 14/11/2011
 * Time: 22:41
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
read tools/basis.anubis

public type DB_id:
  none,
  db_id(Int value).
  
public type DB_datetime:
  datetime(String datetime).

public type DB_date:
  date(String date).
  
public type DB_integer:
  db_integer(Int value).
  

public define String
  to_String
  (
    DB_id idx
  )=
  if idx is
  {
    none        then "none",
    db_id(idx)  then abs_to_decimal(idx)
  }.
  
public define String
  to_String
  (
    DB_date d
  )= 
  date(d).


  
public define String
  to_String
  (
    DB_datetime d
  )=
  datetime(d).


    
public define String
  to_DBString
  (
    Bool value
  )=
  if value then "1" else "0".
  
public define Int
  to_DBInt
  (
    Bool value
  )=
  if value then 1 else 0.
  
public type SQLite3_update_field:
  field(String column, SQLite3Bind bind).
  

 * Some Bind helper *