Book/dbplus-Phpdoc专题
DB++
目录
- 简介
- 安装/配置
- 预定义常量
- DB++ 函数
- dbplus_add — Add a tuple to a relation
- dbplus_aql — Perform AQL query
- dbplus_chdir — Get/Set database virtual current directory
- dbplus_close — Close a relation
- dbplus_curr — Get current tuple from relation
- dbplus_errcode — Get error string for given errorcode or last error
- dbplus_errno — Get error code for last operation
- dbplus_find — Set a constraint on a relation
- dbplus_first — Get first tuple from relation
- dbplus_flush — Flush all changes made on a relation
- dbplus_freealllocks — Free all locks held by this client
- dbplus_freelock — Release write lock on tuple
- dbplus_freerlocks — Free all tuple locks on given relation
- dbplus_getlock — Get a write lock on a tuple
- dbplus_getunique — Get an id number unique to a relation
- dbplus_info — Get information about a relation
- dbplus_last — Get last tuple from relation
- dbplus_lockrel — Request write lock on relation
- dbplus_next — Get next tuple from relation
- dbplus_open — Open relation file
- dbplus_prev — Get previous tuple from relation
- dbplus_rchperm — Change relation permissions
- dbplus_rcreate — Creates a new DB++ relation
- dbplus_rcrtexact — Creates an exact but empty copy of a relation including indices
- dbplus_rcrtlike — Creates an empty copy of a relation with default indices
- dbplus_resolve — Resolve host information for relation
- dbplus_restorepos — Restore position
- dbplus_rkeys — Specify new primary key for a relation
- dbplus_ropen — Open relation file local
- dbplus_rquery — Perform local (raw) AQL query
- dbplus_rrename — Rename a relation
- dbplus_rsecindex — Create a new secondary index for a relation
- dbplus_runlink — Remove relation from filesystem
- dbplus_rzap — Remove all tuples from relation
- dbplus_savepos — Save position
- dbplus_setindex — Set index
- dbplus_setindexbynumber — Set index by number
- dbplus_sql — Perform SQL query
- dbplus_tcl — Execute TCL code on server side
- dbplus_tremove — Remove tuple and return new current tuple
- dbplus_undo — Undo
- dbplus_undoprepare — Prepare undo
- dbplus_unlockrel — Give up write lock on relation
- dbplus_unselect — Remove a constraint from relation
- dbplus_update — Update specified tuple in relation
- dbplus_xlockrel — Request exclusive lock on relation
- dbplus_xunlockrel — Free exclusive lock on relation
db++, made by the German company » Concept asa, is a relational database system with high performance and low memory and disk usage in mind. While providing SQL as an additional language interface, it is not really an SQL database in the first place but provides its own AQL query language which is much more influenced by the relational algebra than SQL is.
Concept asa always had an interest in supporting open source languages, db++ has had Perl and Tcl call interfaces for years now and uses Tcl as its internal stored procedure language.
Note:
此扩展已被移至 » PECL 资源库且不再与 PHP 捆绑。4.3.0
Warning
此扩展是实验性 的。 此扩展的表象,包括其函数名称以及其他此扩展的相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本扩展风险自担。
安装/配置
目录
需求
This extension relies on external client libraries so you have to have a db++ client installed on the system you want to use this extension on.
» Concept asa provides » db++ Demo versions and » documentation for Linux, some other Unix versions. There is also a Windows version of db++, but this extension doesn't support it (yet).
安装
此扩展已被移至 » PECL 资源库且不再与 PHP 捆绑。4.3.0
安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装章节中找到。更多信息如新的发行版本、下载、源文件、 维护人员信息及变更日志等,都在此处: » https://pecl.php.net/package/dbplus.
In order to build this extension yourself you need the db++ client libraries and header files to be installed on your system (these are included in the db++ installation archives by default). You have to run configure with option --with-dbplus to build this extension.
configure looks for the client libraries and header files under the
default paths /usr/dbplus
, /usr/local/dbplus
and /opt/dblus
. If
you have installed db++ in a different place you have add the
installation path to the configure option like this:
--with-dbplus=/your/installation/path.
运行时配置
此扩展没有在 php.ini
中定义配置指令。
资源类型
dbplus_relation
Most db++ functions operate on or return dbplus_relation
resources. A
dbplus_relation
is a handle to a stored relation or a relation
generated as the result of a query.
预定义常量
目录
下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。
db++ error codes
PHP Constant | db++ constant | meaning |
---|---|---|
DBPLUS_ERR_NOERR (int) |
ERR_NOERR | Null error condition |
DBPLUS_ERR_DUPLICATE (int) |
ERR_DUPLICATE | Tried to insert a duplicate tuple |
DBPLUS_ERR_EOSCAN (int) |
ERR_EOSCAN | End of scan from rget() |
DBPLUS_ERR_EMPTY (int) |
ERR_EMPTY | Relation is empty (server) |
DBPLUS_ERR_CLOSE (int) |
ERR_CLOSE | The server can't close |
DBPLUS_ERR_WLOCKED (int) |
ERR_WLOCKED | The record is write locked |
DBPLUS_ERR_LOCKED (int) |
ERR_LOCKED | Relation was already locked |
DBPLUS_ERR_NOLOCK (int) |
ERR_NOLOCK | Relation cannot be locked |
DBPLUS_ERR_READ (int) |
ERR_READ | Read error on relation |
DBPLUS_ERR_WRITE (int) |
ERR_WRITE | Write error on relation |
DBPLUS_ERR_CREATE (int) |
ERR_CREATE | Create() system call failed |
DBPLUS_ERR_LSEEK (int) |
ERR_LSEEK | Lseek() system call failed |
DBPLUS_ERR_LENGTH (int) |
ERR_LENGTH | Tuple exceeds maximum length |
DBPLUS_ERR_OPEN (int) |
ERR_OPEN | Open() system call failed |
DBPLUS_ERR_WOPEN (int) |
ERR_WOPEN | Relation already opened for writing |
DBPLUS_ERR_MAGIC (int) |
ERR_MAGIC | File is not a relation |
DBPLUS_ERR_VERSION (int) |
ERR_VERSION | File is a very old relation |
DBPLUS_ERR_PGSIZE (int) |
ERR_PGSIZE | Relation uses a different page size |
DBPLUS_ERR_CRC (int) |
ERR_CRC | Invalid crc in the superpage |
DBPLUS_ERR_PIPE (int) |
ERR_PIPE | Piped relation requires lseek() |
DBPLUS_ERR_NIDX (int) |
ERR_NIDX | Too many secondary indices |
DBPLUS_ERR_MALLOC (int) |
ERR_MALLOC | Malloc() call failed |
DBPLUS_ERR_NUSERS (int) |
ERR_NUSERS | Error use of max users |
DBPLUS_ERR_PREEXIT (int) |
ERR_PREEXIT | Caused by invalid usage |
DBPLUS_ERR_ONTRAP (int) |
ERR_ONTRAP | Caused by a signal |
DBPLUS_ERR_PREPROC (int) |
ERR_PREPROC | Error in the preprocessor |
DBPLUS_ERR_DBPARSE (int) |
ERR_DBPARSE | Error in the parser |
DBPLUS_ERR_DBRUNERR (int) |
ERR_DBRUNERR | Run error in db |
DBPLUS_ERR_DBPREEXIT (int) |
ERR_DBPREEXIT | Exit condition caused by prexit() * procedure |
DBPLUS_ERR_WAIT (int) |
ERR_WAIT | Wait a little (Simple only) |
DBPLUS_ERR_CORRUPT_TUPLE (int) |
ERR_CORRUPT_TUPLE | A client sent a corrupt tuple |
DBPLUS_ERR_WARNING0 (int) |
ERR_WARNING0 | The Simple routines encountered a non fatal error which was corrected |
DBPLUS_ERR_PANIC (int) |
ERR_PANIC | The server should not really die but after a disaster send ERR_PANIC to all its clients |
DBPLUS_ERR_FIFO (int) |
ERR_FIFO | Can't create a fifo |
DBPLUS_ERR_PERM (int) |
ERR_PERM | Permission denied |
DBPLUS_ERR_TCL (int) |
ERR_TCL | TCL_error |
DBPLUS_ERR_RESTRICTED (int) |
ERR_RESTRICTED | Only two users |
DBPLUS_ERR_USER (int) |
ERR_USER | An error in the use of the library by an application programmer |
DBPLUS_ERR_UNKNOWN (int) |
ERR_UNKNOWN |
dbplus_add
Add a tuple to a relation
说明
int <span
class="methodname">dbplus_add ( <span
class="type">resource $relation
, <span
class="methodparam">array $tuple
)
Adds a tuple to a relation
.
参数
relation
tuple
An array of attribute/value pairs to be inserted into the given
relation
.
After successful execution this array will contain the complete data of the newly created tuple, including all implicitly set domain fields like sequences.
返回值
The function will return DBPLUS_ERR_NOERR
on success or a db++
error code on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_errcode
dbplus_aql
Perform AQL query
说明
resource <span
class="methodname">dbplus_aql ( <span
class="type">string $query
[, <span
class="methodparam">string $server
[, string
$dbpath
]] )
Executes an AQL query
on the given server
and dbpath
.
参数
query
The AQL query to be executed. Further information on the AQL (Algebraic
Query Language) is provided in the original db++ manual.
server
dbpath
返回值
Returns a relation handle on success. The result data may be fetched from this relation by calling dbplus_next and dbplus_curr. Other relation access functions will not work on a result relation.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_chdir
Get/Set database virtual current directory
说明
string <span
class="methodname">dbplus_chdir ([ <span
class="methodparam">string $newdir
]
)
Changes the virtual current directory where relation files will be looked for by dbplus_open.
参数
newdir
The new directory for relation files. You can omit this parameter to
query the current working directory.
返回值
Returns the absolute path of the current directory.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_close
Close a relation
说明
mixed <span
class="methodname">dbplus_close ( <span
class="methodparam">resource
$relation
)
Closes a relation previously opened by <span class="function">dbplus_open.
参数
relation
A relation opened by dbplus_open.
返回值
Returns true
on success or DBPLUS_ERR_UNKNOWN
on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_curr
Get current tuple from relation
说明
int <span
class="methodname">dbplus_curr ( <span
class="type">resource $relation
, <span
class="methodparam">array &$tuple
)
Reads the data for the current tuple for the given relation
.
参数
relation
A relation opened by dbplus_open.
tuple
The data will be passed back in this parameter, as an associative array.
返回值
The function will return zero (aka. DBPLUS_ERR_NOERR
) on success
or a db++ error code on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_first
- dbplus_prev
- dbplus_next
- dbplus_last
- dbplus_errcode
dbplus_errcode
Get error string for given errorcode or last error
说明
string <span
class="methodname">dbplus_errcode ([ <span
class="methodparam">int $errno
] )
Returns a clear error string for the given error code.
参数
errno
The error code. If not provided, the result code of the last db++
operation is assumed.
返回值
Returns the error message.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_errno
Get error code for last operation
说明
int <span class="methodname">dbplus_errno ( <span class="methodparam">void )
Returns the error code returned by the last db++ operation.
返回值
Returns the error code, as an integer.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_errcode
dbplus_find
Set a constraint on a relation
说明
int <span
class="methodname">dbplus_find ( <span
class="type">resource $relation
, <span
class="methodparam">array
$constraints
, <span
class="type">mixed $tuple
)
Places a constraint on the given relation
.
Further calls to functions like <span class="function">dbplus_curr or <span class="function">dbplus_next will only return tuples matching the given constraints.
参数
relation
A relation opened by dbplus_open.
constraints
Constraints are triplets of strings containing of a domain name, a
comparison operator and a comparison value. The constraints
parameter
array may consist of a collection of string arrays, each of which
contains a domain, an operator and a value, or of a single string array
containing a multiple of three elements.
The comparison operator may be one of the following strings: '==', '>', '>=', '\<', '\<=', '!=', '~' for a regular expression match and 'BAND' or 'BOR' for bitwise operations.
tuple
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_unselect
dbplus_first
Get first tuple from relation
说明
int <span
class="methodname">dbplus_first ( <span
class="methodparam">resource
$relation
, <span
class="type">array &$tuple
)
Reads the data for the first tuple for the given relation
, makes it
the current tuple and pass it back as an associative array in tuple
.
参数
relation
A relation opened by dbplus_open.
tuple
返回值
Returns DBPLUS_ERR_NOERR
on success or a db++ error code on
failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_curr
- dbplus_prev
- dbplus_next
- dbplus_last
- dbplus_errcode
dbplus_flush
Flush all changes made on a relation
说明
int <span
class="methodname">dbplus_flush ( <span
class="methodparam">resource
$relation
)
Writes all changes applied to relation
since the last flush to disk.
参数
relation
A relation opened by dbplus_open.
返回值
Returns DBPLUS_ERR_NOERR
on success or a db++ error code on
failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_errcode
dbplus_freealllocks
Free all locks held by this client
说明
int <span class="methodname">dbplus_freealllocks ( <span class="methodparam">void )
Frees all tuple locks held by this client.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_getlock
- dbplus_freelock
- dbplus_freerlocks
dbplus_freelock
Release write lock on tuple
说明
int <span
class="methodname">dbplus_freelock ( <span
class="methodparam">resource
$relation
, <span
class="type">string $tuple
)
Releases a write lock on the given tuple
previously obtained by <span
class="function">dbplus_getlock.
参数
relation
A relation opened by dbplus_open.
tuple
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_getlock
- dbplus_freerlocks
- dbplus_freealllocks
dbplus_freerlocks
Free all tuple locks on given relation
说明
int <span
class="methodname">dbplus_freerlocks ( <span
class="methodparam">resource
$relation
)
Frees all tuple locks held on the given relation
.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_getlock
- dbplus_freelock
- dbplus_freealllocks
dbplus_getlock
Get a write lock on a tuple
说明
int <span
class="methodname">dbplus_getlock ( <span
class="methodparam">resource
$relation
, <span
class="type">string $tuple
)
Requests a write lock on the specified tuple
.
参数
relation
A relation opened by dbplus_open.
tuple
返回值
Returns zero on success or a non-zero error code, especially
DBPLUS_ERR_WLOCKED
on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_freelock
- dbplus_freerlocks
- dbplus_freealllocks
dbplus_getunique
Get an id number unique to a relation
说明
int <span
class="methodname">dbplus_getunique ( <span
class="methodparam">resource
$relation
, <span
class="type">int $uniqueid
)
Obtains a number guaranteed to be unique for the given relation
and
will pass it back in the variable given as uniqueid
.
参数
relation
A relation opened by dbplus_open.
uniqueid
返回值
Returns DBPLUS_ERR_NOERR
on success or a db++ error code on
failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_info
Get information about a relation
说明
int <span
class="methodname">dbplus_info ( <span
class="type">resource $relation
, <span
class="methodparam">string $key
,
array
&$result
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
key
result
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_last
Get last tuple from relation
说明
int <span
class="methodname">dbplus_last ( <span
class="type">resource $relation
, <span
class="methodparam">array &$tuple
)
Reads the data for the last tuple for the given relation
, makes it the
current tuple and pass it back as an associative array in tuple
.
参数
relation
A relation opened by dbplus_open.
tuple
返回值
Returns DBPLUS_ERR_NOERR
on success or a db++ error code on
failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_first
- dbplus_curr
- dbplus_prev
- dbplus_next
dbplus_lockrel
Request write lock on relation
说明
int <span
class="methodname">dbplus_lockrel ( <span
class="methodparam">resource
$relation
)
Requests a write lock on the given relation
.
Other clients may still query the relation, but can't alter it while it is locked.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_next
Get next tuple from relation
说明
int <span
class="methodname">dbplus_next ( <span
class="type">resource $relation
, <span
class="methodparam">array &$tuple
)
Reads the data for the next tuple for the given relation
, makes it the
current tuple and will pass it back as an associative array in tuple
.
参数
relation
A relation opened by dbplus_open.
tuple
返回值
Returns DBPLUS_ERR_NOERR
on success or a db++ error code on
failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_first
- dbplus_curr
- dbplus_prev
- dbplus_last
dbplus_open
Open relation file
说明
resource <span
class="methodname">dbplus_open ( <span
class="type">string $name
)
Opens the given relation file.
参数
name
Can be either a file name or a relative or absolute path name. This will
be mapped in any case to an absolute relation file path on a specific
host machine and server.
返回值
On success a relation file resource (cursor) is returned which must be used in any subsequent commands referencing the relation. Failure leads to a zero return value, the actual error code may be asked for by calling dbplus_errno.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_prev
Get previous tuple from relation
说明
int <span
class="methodname">dbplus_prev ( <span
class="type">resource $relation
, <span
class="methodparam">array &$tuple
)
Reads the data for the previous tuple for the given relation
, makes it
the current tuple and will pass it back as an associative array in
tuple
.
参数
relation
A relation opened by dbplus_open.
tuple
返回值
Returns DBPLUS_ERR_NOERR
on success or a db++ error code on
failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_first
- dbplus_curr
- dbplus_next
- dbplus_last
dbplus_rchperm
Change relation permissions
说明
int <span
class="methodname">dbplus_rchperm ( <span
class="methodparam">resource
$relation
, <span
class="type">int $mask
, <span
class="type">string $user
, <span
class="methodparam">string $group
)
Changes access permissions as specified by mask
, user
and group
.
The values for these are operating system specific.
参数
relation
A relation opened by dbplus_open.
mask
user
group
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rcreate
Creates a new DB++ relation
说明
resource <span
class="methodname">dbplus_rcreate ( <span
class="methodparam">string $name
,
mixed
$domlist
[, <span
class="type">bool $overwrite
] )
Creates a new relation. Any existing relation sharing the same name
will be overwritten if the relation is currently not in use and
overwrite
is set to TRUE.
参数
name
domlist
A combination of domains. May be passed as a single domain name string
or as an array of domain names.
This parameter should contain the domain specification for the new relation within an array of domain description strings. A domain description string consists of a domain name unique to this relation, a slash and a type specification character. See the db++ documentation, especially the dbcreate(1) manpage, for a description of available type specifiers and their meanings.
Note:
This function will also accept a string with space delimited domain description strings, but it is recommended to use an array
overwrite
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rcrtexact
Creates an exact but empty copy of a relation including indices
说明
mixed <span
class="methodname">dbplus_rcrtexact ( <span
class="methodparam">string $name
,
resource
$relation
[, <span
class="type">bool $overwrite
] )
dbplus_rcrtexact will create an exact but
empty copy of the given relation
under a new name
.
参数
name
relation
The copied relation, opened by <span
class="function">dbplus_open.
overwrite
An existing relation by the same name
will only be overwritten if this
parameter is set to true
and no other process is currently using
the relation.
返回值
Returns resource on success or DBPLUS_ERR_UNKNOWN
on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rcrtlike
Creates an empty copy of a relation with default indices
说明
mixed <span
class="methodname">dbplus_rcrtlike ( <span
class="methodparam">string $name
,
resource
$relation
[, <span
class="type">int $overwrite
] )
dbplus_rcrtexact will create an empty
copy of the given relation
under a new name
, but with default
indices.
参数
name
relation
The copied relation, opened by <span
class="function">dbplus_open.
overwrite
An existing relation by the same name
will only be overwritten if this
parameter is set to true
and no other process is currently using
the relation.
返回值
Returns resource on success or DBPLUS_ERR_UNKNOWN
on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_resolve
Resolve host information for relation
说明
array <span
class="methodname">dbplus_resolve ( <span
class="methodparam">string
$relation_name
)
dbplus_resolve will try to resolve the
given relation_name
and find out internal server id, real hostname and
the database path on this host.
参数
relation_name
The relation name.
返回值
Returns an array containing these values under the keys sid, host
and host_path or false
on error.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_tcl
dbplus_restorepos
Restore position
说明
int <span
class="methodname">dbplus_restorepos ( <span
class="methodparam">resource
$relation
, <span
class="type">array $tuple
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
tuple
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rkeys
Specify new primary key for a relation
说明
mixed <span
class="methodname">dbplus_rkeys ( <span
class="methodparam">resource
$relation
, <span
class="type">mixed $domlist
)
dbplus_rkeys will replace the current
primary key for relation
with the combination of domains specified by
domlist
.
参数
relation
A relation opened by dbplus_open.
domlist
A combination of domains. May be passed as a single domain name string
or as an array of domain names.
返回值
Returns resource on success or DBPLUS_ERR_UNKNOWN
on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_ropen
Open relation file local
说明
resource <span
class="methodname">dbplus_ropen ( <span
class="methodparam">string $name
)
dbplus_ropen will open the relation
file
locally for quick access without any client/server overhead.
Access is read only and only dbplus_curr
and dbplus_next may be applied to the
returned relation.
参数
name
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rquery
Perform local (raw) AQL query
说明
resource <span
class="methodname">dbplus_rquery ( <span
class="methodparam">string $query
[,
string
$dbpath
] )
dbplus_rquery performs a local (raw) AQL query using an AQL interpreter embedded into the db++ client library. dbplus_rquery is faster than <span class="function">dbplus_aql but will work on local data only.
参数
query
dbpath
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rrename
Rename a relation
说明
int <span
class="methodname">dbplus_rrename ( <span
class="methodparam">resource
$relation
, <span
class="type">string $name
)
dbplus_rrename will change the name of
relation
to name
.
参数
relation
A relation opened by dbplus_open.
name
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rsecindex
Create a new secondary index for a relation
说明
mixed <span
class="methodname">dbplus_rsecindex ( <span
class="methodparam">resource
$relation
, <span
class="type">mixed $domlist
, <span
class="methodparam">int $type
)
dbplus_rsecindex will create a new
secondary index for relation
with consists of the domains specified by
domlist
and is of type type
参数
relation
A relation opened by dbplus_open.
domlist
A combination of domains. May be passed as a single domain name string
or as an array of domain names.
type
返回值
Returns resource on success or DBPLUS_ERR_UNKNOWN
on failure.
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_runlink
Remove relation from filesystem
说明
int <span
class="methodname">dbplus_runlink ( <span
class="methodparam">resource
$relation
)
dbplus_runlink will close and remove the
relation
.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_rzap
Remove all tuples from relation
说明
int <span
class="methodname">dbplus_rzap ( <span
class="type">resource $relation
)
dbplus_rzap will remove all tuples from
relation
.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_savepos
Save position
说明
int <span
class="methodname">dbplus_savepos ( <span
class="methodparam">resource
$relation
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_setindex
Set index
说明
int <span
class="methodname">dbplus_setindex ( <span
class="methodparam">resource
$relation
, <span
class="type">string $idx_name
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
idx_name
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_setindexbynumber
Set index by number
说明
int <span
class="methodname">dbplus_setindexbynumber ( <span
class="methodparam">resource
$relation
, <span
class="type">int $idx_number
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
idx_number
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_sql
Perform SQL query
说明
resource <span
class="methodname">dbplus_sql ( <span
class="type">string $query
[, <span
class="methodparam">string $server
[, string
$dbpath
]] )
Warning
本函数还未编写文档,仅有参数列表。
参数
query
server
dbpath
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_tcl
Execute TCL code on server side
说明
string <span
class="methodname">dbplus_tcl ( <span
class="type">int $sid
, <span
class="type">string $script
)
A db++ server will prepare a TCL interpreter for each client connection. This interpreter will enable the server to execute TCL code provided by the client as a sort of stored procedures to improve the performance of database operations by avoiding client/server data transfers and context switches.
dbplus_tcl needs to pass the client
connection id the TCL script
code should be executed by. <span
class="function">dbplus_resolve will provide this connection id.
The function will return whatever the TCL code returns or a TCL error
message if the TCL code fails.
参数
sid
script
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_resolve
dbplus_tremove
Remove tuple and return new current tuple
说明
int <span
class="methodname">dbplus_tremove ( <span
class="methodparam">resource
$relation
, <span
class="type">array $tuple
[, <span
class="methodparam">array &$current
] )
dbplus_tremove removes tuple
from
relation
if it perfectly matches a tuple within the relation.
current
, if given, will contain the data of the new current tuple
after calling dbplus_tremove.
参数
relation
A relation opened by dbplus_open.
tuple
current
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_undo
Undo
说明
int <span
class="methodname">dbplus_undo ( <span
class="type">resource $relation
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_undoprepare
Prepare undo
说明
int <span
class="methodname">dbplus_undoprepare ( <span
class="methodparam">resource
$relation
)
Warning
本函数还未编写文档,仅有参数列表。
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_unlockrel
Give up write lock on relation
说明
int <span
class="methodname">dbplus_unlockrel ( <span
class="methodparam">resource
$relation
)
Release a write lock previously obtained by <span class="function">dbplus_lockrel.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_unselect
Remove a constraint from relation
说明
int <span
class="methodname">dbplus_unselect ( <span
class="methodparam">resource
$relation
)
Calling dbplus_unselect will remove a
constraint previously set by dbplus_find
on relation
.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_update
Update specified tuple in relation
说明
int <span
class="methodname">dbplus_update ( <span
class="methodparam">resource
$relation
, <span
class="type">array $old
, <span
class="methodparam">array $new
)
dbplus_update replaces the old
tuple
with the data from the new
one, only if the old
completely matches a
tuple within relation
.
参数
relation
A relation opened by dbplus_open.
old
The old tuple.
new
The new tuple.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
dbplus_xlockrel
Request exclusive lock on relation
说明
int <span
class="methodname">dbplus_xlockrel ( <span
class="methodparam">resource
$relation
)
Request an exclusive lock on relation
preventing even read access from
other clients.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
参见
- dbplus_xunlockrel
dbplus_xunlockrel
Free exclusive lock on relation
说明
int <span
class="methodname">dbplus_xunlockrel ( <span
class="methodparam">resource
$relation
)
Releases an exclusive lock previously obtained by <span class="function">dbplus_xlockrel.
参数
relation
A relation opened by dbplus_open.
返回值
注释
Warning
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
目录
- dbplus_add — Add a tuple to a relation
- dbplus_aql — Perform AQL query
- dbplus_chdir — Get/Set database virtual current directory
- dbplus_close — Close a relation
- dbplus_curr — Get current tuple from relation
- dbplus_errcode — Get error string for given errorcode or last error
- dbplus_errno — Get error code for last operation
- dbplus_find — Set a constraint on a relation
- dbplus_first — Get first tuple from relation
- dbplus_flush — Flush all changes made on a relation
- dbplus_freealllocks — Free all locks held by this client
- dbplus_freelock — Release write lock on tuple
- dbplus_freerlocks — Free all tuple locks on given relation
- dbplus_getlock — Get a write lock on a tuple
- dbplus_getunique — Get an id number unique to a relation
- dbplus_info — Get information about a relation
- dbplus_last — Get last tuple from relation
- dbplus_lockrel — Request write lock on relation
- dbplus_next — Get next tuple from relation
- dbplus_open — Open relation file
- dbplus_prev — Get previous tuple from relation
- dbplus_rchperm — Change relation permissions
- dbplus_rcreate — Creates a new DB++ relation
- dbplus_rcrtexact — Creates an exact but empty copy of a relation including indices
- dbplus_rcrtlike — Creates an empty copy of a relation with default indices
- dbplus_resolve — Resolve host information for relation
- dbplus_restorepos — Restore position
- dbplus_rkeys — Specify new primary key for a relation
- dbplus_ropen — Open relation file local
- dbplus_rquery — Perform local (raw) AQL query
- dbplus_rrename — Rename a relation
- dbplus_rsecindex — Create a new secondary index for a relation
- dbplus_runlink — Remove relation from filesystem
- dbplus_rzap — Remove all tuples from relation
- dbplus_savepos — Save position
- dbplus_setindex — Set index
- dbplus_setindexbynumber — Set index by number
- dbplus_sql — Perform SQL query
- dbplus_tcl — Execute TCL code on server side
- dbplus_tremove — Remove tuple and return new current tuple
- dbplus_undo — Undo
- dbplus_undoprepare — Prepare undo
- dbplus_unlockrel — Give up write lock on relation
- dbplus_unselect — Remove a constraint from relation
- dbplus_update — Update specified tuple in relation
- dbplus_xlockrel — Request exclusive lock on relation
- dbplus_xunlockrel — Free exclusive lock on relation