= Swift

== Public API

Public API minus the optional stuff like Pool, IdentityMap, Migrations etc.

  Swift
    .setup  #=> Adapter
    .db     #=> Adapter
    .schema #=> [Scheme, ...]
    .trace

    # Abstract.
    Adapter
      .new         #=> Adapter
      #all         #=> Result
      #begin       #=> Adapter
      #commit
      #create      #=> Scheme or Result
      #destroy     #=> Scheme or Result
      #execute     #=> Result
      #first       #=> Scheme
      #get         #=> Scheme
      #prepare     #=> Statement
      #rollback
      #transaction #=> Adapter
      #update      #=> Scheme or Result
      #reconnect
      #delete      #=> Result

      # TODO: DBI < Adapter
        # returning? #=> true or false

    # Concrete.
    DB
      Mysql    < Adapter # TODO: Adapter::DBI?
      Postgres < Adapter # TODO: Adapter::DBI?
      Sqlite3  < Adapter # TODO: Adapter::DBI?

    # Enumerable collection of Scheme or Hash tuples.
    Result
      .new       #=> Result
      #insert_id #=> Numeric
      #fields    #=> [Symbol, ...] # Field names identical to .first.keys if rows > 0

    Statement
      .new     #=> Statement
      #execute #=> Result

    Scheme
      .all       #=> Result
      .attribute #=> Type
      .create    #=> Scheme or Result
      .first     #=> Scheme
      .get       #=> Scheme
      .header    #=> Header
      .load      #=> Scheme
      .new       #=> Scheme
      .scheme    #=> Alias for self.class
      .store     #=> Symbol
      #destroy   #=> Scheme or Result
      #tuple     #=> Hash
      #update    #=> Scheme or Result

    # Enumerable collection of Types for Scheme
    Header
      .new        #=> Header
      #all        #=> [Type, ...]
      #insertable #=> [Type, ...]
      #keys       #=> [Symbol, ...]
      #new_tuple  #=> Hash
      #push       #=> Type
      #serial     #=> Symbol or nil.
      #updatable  #=> [Type, ...]

    # Abstract.
    Attribute
      .new                   #=> Attribute
      #name                  #=> Symbol
      #field                 #=> Symbol
      #key                   #=> true or false
      #serial                #=> Symbol or nil
      #default               #=> Object
      #define_scheme_methods

    # Concrete
    Type
      BigDecimal < Attribute
      Boolean    < Attribute
      Float      < Attribute
      Integer    < Attribute
      IO         < Attribute
      String     < Attribute
      Time       < Attribute # Soon to be DateTime?
