next up previous contents
Next: Building an Application Up: Command-Line Compiler Previous: Command-Line Compiler   Contents


Project Files

The basic inputs to the urweb compiler are project files, which have the extension .urp. Here is a sample .urp file.

database dbname=test
sql crud1.sql

crud
crud1

The database line gives the database information string to pass to libpq. In this case, the string only says to connect to a local database named test.

The sql line asks for an SQL source file to be generated, giving the commands to run to create the tables and sequences that this application expects to find. After building this .urp file, the following commands could be used to initialize the database, assuming that the current UNIX user exists as a Postgres user with database creation privileges:

createdb test
psql -f crud1.sql test

A blank line separates the named directives from a list of modules to include in the project. Any line may contain a shell-script-style comment, where any suffix of a line starting at a hash character # is ignored.

For each entry M in the module list, the file M.urs is included in the project if it exists, and the file M.ur must exist and is always included.

Here is the complete list of directive forms. ``FFI'' stands for ``foreign function interface,'' Ur's facility for interaction between Ur programs and C and JavaScript libraries.


next up previous contents
Next: Building an Application Up: Command-Line Compiler Previous: Command-Line Compiler   Contents
2014-07-14