The metamodel in OpenResty is a set of internal database schemas or tables for storing meta information regarding the user data.
They're usually invisible to the outside users and their names are carefully chosen so as to prevent potential naming conflicts with users' objects.

Usually it stores the version and other general information of the global metamodel itself. Note that the version of the metamodel is independent of the version number of the whole OpenResty server implementation. For instance, the OpenResty 0.1.8 uses metamodel 0.001 while the versions earlier does not have a versioned metamodel.

This table usually has only one row. But it's also fine to keep track of all the version history. The largest version number will be considered the current version of the metamodel in the current user schema.

The captcha_key column stores the secret key used in captcha generation, whose value must be exactly 16 bytes long and contains only characters in [0-9a-zA-Z].

Each OpenResty account registered by an outside user has a PostgreSQL schema for storing its models, views, roles, actions, and other user objects. Such schema has the same name as the account name. For instance, account carrie has a corresponding database schema (or namespace) named carrie. The carrie schema has the following meta tables:

The role column stores the name of the role which owns the current rule.

Each access rule has two components, HTTP method and the (abbreviated) URL, which are saved in the columns method, prefix, and segments, respectively. An example is that method has a value of 'GET' and url has a value of '/=/model/~/~/~'.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found at