DatAdmin
Export - multiple files
- Can be used to export database into more files in filesystem structure
- Files list - constains list of output file name templates.
From one item in this list can be created more output files, it depends on data in exported database.
- File name - File name template. Constains full file path.
Can also contain column inmes in form #COLUMN# (uppercase) from query, which can be specified lower.
- File type - může obsahovat jednu z možností:
- Template
- Python
- BLOB
- Data store
- Query - contains query, which is run on exported database related to selected file.
For each row of query result is created on output file.
To prevent overwriting files use file names with column references #COLUMN#.
File type BLOB
Is the simplest file type. Into file is inserted content of one BLOB field, which is specified using SQL query.
You can use references to file-defining query in form #COLUMN# (uppercase).
File type Python
Contains script in Python language. Python standard ouput stream sys.stdout is redirected to output file,
so calling print command creates records in output file. Fields from file-defining query
are available as variables in form _COLUMN_ (uppercase). Most generic file type.
API is not yet documented, in case of questions please contact DatAdmin support, mail@datadmin.com.
File type Data Store
Using this file type you can export data into any of DatAdmin table-export format implementing neccessary
protocols, eg CSV, HTML. It is neccessary to specify query, which is used as data source for output data
(query can containt values in form #COLUMN#).
File type template
Is very generic, but simplier to use than Python file type. Into output file is inserted content of text field,
there are implemented some special tags like in PHP or ASP.NET.
If commands or expressions in Python are used, there is possiblity to use special variables _COLUMN_ referencing
data from file-defining query.
- <%= Python expression %> - evaluates expression, is written to output
- <@= select ... @> - select command - result should containt one value (one row with one column),
this value is written to output. Text in braces {} is interpreted as Python expression.
This is way how to parametrize SQL commands.
- <@ select ... @> ... section, which is repeated for each result row ... <@ end select @>
Fields of result are available under variable named _column_ (lowercase, so there cannot be conflicts
with file-defining query columns). Word "select" must be in lowercase.
- <@ for variable in expression @> ... <@ end for @> classical for-each cycle.