Windows: Difference between revisions

From NEOSYS Dev Wiki
Jump to navigationJump to search
Line 75: Line 75:
|<U>EDITING AND COMPILING</U>
|<U>EDITING AND COMPILING</U>
|-
|-
|edic hello ||Creates a skeleton hello.cpp file using nano editor. edic will only compile on exit if saved, so make some change before you exit.
|edic hello ||edic=edit+compile+catalog. Creates a skeleton hello.cpp file using nano editor. edic will only compile on exit if saved, so make some change before you exit.
|-
|-
|hello ||Run it
|hello ||Run it
Line 99: Line 99:
|list dict_voc ||if you understand this then you understand your pick
|list dict_voc ||if you understand this then you understand your pick
|-
|-
|edir myclients SB001 ||you can edit data or dictionaries directly
|edir myclients SB001 ||you can edit data or dictionaries directly. edir="edit record"
|-
|-
|delete myclients SB001 ||useful command line tool
|delete myclients SB001 ||useful command line tool

Revision as of 00:49, 18 October 2010

Downloading and Installing Exodus

http://code.google.com/p/exodusdb/downloads

C++ Compiler

If you want to write or compile Exodus programs on Windows you need a Microsoft C++ compiler. You don't need a C++ compiler to just used the Exodus command line to access the database or run prepackaged Exodus programs.

MSVC

  • Visual Studio 2003 Professional
  • Visual Studio 2005 Professional
  • Visual Studio 2005 Express (Requires Platform SDK)
  • Visual Studio 2008 Express (works)
  • Visual Studio 2010 Express (not known)

A standard install of the free VS Express C++ preferably in the default location on C: or parallel default location but on the same drive as Exodus. No need for any SQL or options.

http://www.microsoft.com/Express/vc/

Postgresql

If you want to use Exodus to provide multivalue database functionality then you must already have or install a PostgreSQL database.

http://www.postgresql.org/download/windows

Postgres does not have to be on the same server as Exodus, however, if it is not, dictionary entries cannot call Exodus subroutines.

Windows Postgres plugin

At the time of writing, the Windows installer does not install the postgres plugin automatically so you need to do something like the following.

copy "C:\Program Files\Exodus\10.10\lib\pgexodus-8.dll" "C:\Program Files\PostgreSQL\8.4\lib\pgexodus.dll"
copy "C:\Program Files\Exodus\10.10\lib\pgexodus-9.dll" "C:\Program Files\PostgreSQL\9.0\lib\pgexodus.dll"

Postgres configuration

By default, Exodus assumes the following postgres configuration. This is very convenient for quick setups but of course is not secure.

host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10

The following Exodus command creates the default database and password. It prompts for a postgres admin user and password to do so.

configexodus

Alternatively, you can use any available Postgres utility to create an initial database and user yourself. If you wish Exodus to be able to create databases, and drop any databases it creates, the user you create should have database creation rights. The user you create does not need admin rights.

Storing the configuration

notepad %USERPROFILE%\.exodus
host=127.0.0.1 port=5432 dbname=exodus user=exodus password=somesillysecret connect_timeout=10

The following environment variables can override default and .exodus parameters on a one by one basis.

set EXODUS_HOST=127.0.0.1
set EXODUS_PORT=5432
set EXODUS_DBNAME=exodus
set EXODUS_USER=exodus
set EXODUS_PASSWORD=somesillysecret
set EXODUS_TIMEOUT=10

Using Exodus

Start, All Programs, Exodus, Exodus Console

Try the following commands.

Command Comment
configexodus One time setup of default database and user in postgres (exodus and exodus)
EDITING AND COMPILING
edic hello edic=edit+compile+catalog. Creates a skeleton hello.cpp file using nano editor. edic will only compile on exit if saved, so make some change before you exit.
hello Run it
compile hello compile without editing
edic testsort Browse a sample exodus program showing all fundamental database operations including dictionaries and list.
DATABASE OPERATIONS
compile testsort compile the preinstalled test program
testsort Run it to generate some data and inspect the output
listfiles quick tool avoiding need to use any database client
list myclients text output - no page/column headers just yet sorry
list myclients (H) html output (port of a fully blown LIST replacement in heavy production use since 2000)
list dict_myclients NB the underscore after "dict" is *required*. "dict(SPACE)myclients" wont work
list dict_voc if you understand this then you understand your pick
edir myclients SB001 you can edit data or dictionaries directly. edir="edit record"
delete myclients SB001 useful command line tool
createfile tempfile ditto
deletefile tempfile ditto
createindex myclients CLIENT_TYPE speeds up select commands on the indexed fields in the traditional way
deleteindex myclients CLIENT_TYPE filenames are case insensitive, keys and fieldnames are CASE SENSITIVE

If you get the following error then you have not completed the installation of pgexodus.dll function in postgres as described in the section on postgres above.

PGRES_FATAL_ERROR: ERROR: function exodus_extract_text(bytea, integer, integer, integer) does not exist

Documentation how to program in Exodus

No programming manual yet but there is a list of functions in wiki at

http://code.google.com/p/exodusdb

Unorganised notes about programming in Exodus

Source code and Exodus development environment

http://code.google.com/p/exodusdb has latest full source code and tools to build exodus from scratch on all supported platforms.

The following Doxygen is not quite up to date but is still informative.

http://devwiki.neosys.com/dox

include\exodusfuncs.h lists the functions that simulates pickish syntax as close as can be achieved. The functionality however should be identical.

include\exodusmacros.h lists a few keywords to simplify programming for application programmers not interested in the raw power of c++.

include\mv.h lists the massive var class definition that defines how to write pick in oo object.method() style syntax.