.. meta:: :keywords: web2py, framework, DAL, データベース抽象化レイヤ, 接続文字列, バリデータ 資料 ==== .. _connection_string: 接続文字列 ---------- .. connection_string_start \ .. list-table:: :widths: 5 10 :header-rows: 1 * - DB管理システム - 接続文字列例 * - SQLite - ``sqlite://storage.db`` * - MySQL - ``mysql://username:password@localhost/test`` * - PostgreSQL - ``postgres://username:password@localhost/test`` * - MSSQL - ``mssql://username:password@localhost/test`` * - FireBird - ``firebird://username:password@localhost/test`` * - Oracle - ``oracle://username/password@test`` * - DB2 - ``db2://username:password@test`` * - Ingres - ``ingres://username:password@localhost/test`` * - Sybase - ``sybase://username:password@localhost/test`` * - Informix - ``informix://username:password@test`` * - Teradata - ``teradata://DSN=dsn;UID=user;PWD=pass;DATABASE=test`` * - Cubrid - ``cubrid://username:password@localhost/test`` * - SAPDB - ``sapdb://username:password@localhost/test`` * - IMAP - ``imap://user:password@server:port`` * - MongoDB - ``mongodb://username:password@localhost/test`` * - Google/SQL - ``google:sql://project:instance/database`` * - Google/NoSQL - ``google:datastore`` `Connection Strings `_ | `接続文字列 `_ より .. connection_string_end .. _default_field_validators: フィールドタイプ毎のデフォルト・バリデータ ---------------------------------------------- +----------------------+------------------------------------------+ |field type |default field validators | +======================+==========================================+ |string |IS_LENGTH(length) ...default length is 512| +----------------------+------------------------------------------+ |text |IS_LENGTH(65536) | +----------------------+------------------------------------------+ |blob |None | +----------------------+------------------------------------------+ |boolean |None | +----------------------+------------------------------------------+ |integer |IS_INT_IN_RANGE(-1e100, 1e100) | +----------------------+------------------------------------------+ |double |IS_FLOAT_IN_RANGE(-1e100, 1e100) | +----------------------+------------------------------------------+ |decimal(n,m) |IS_DECIMAL_IN_RANGE(-1e100, 1e100) | +----------------------+------------------------------------------+ |date |IS_DATE() | +----------------------+------------------------------------------+ |time |IS_TIME() | +----------------------+------------------------------------------+ |datetime |IS_DATETIME() | +----------------------+------------------------------------------+ |password |None | +----------------------+------------------------------------------+ |upload |None | +----------------------+------------------------------------------+ |reference |IS_IN_DB(db,'
.id') | +----------------------+------------------------------------------+ |list:string |None | +----------------------+------------------------------------------+ |list:integer |None | +----------------------+------------------------------------------+ |list:reference
|IS_IN_DB(db,'
.id',multiple=True) | +----------------------+------------------------------------------+ |json |IS_JSON() | +----------------------+------------------------------------------+ |bigint |None | +----------------------+------------------------------------------+ |big-id |None | +----------------------+------------------------------------------+ |big-reference |None | +----------------------+------------------------------------------+ `Record Representation `_ | `レコードの表現 `_ より