Name

sqexport.pl — Squore export utility

Synopsis

sqexport.pl [ option ...] users [ -r ]

sqexport.pl [ option ...] groups [ -m ]

sqexport.pl [ option ...] versions -m [ -l ] [ -u id_user ] id_model

sqexport.pl [ option ...] versions -p [ -l ] [ -u id_user ] id_project

sqexport.pl [ option ...] artefacts -m [ -R ] [ --add-measure measure ...] [ -T type ...] [ -L level ] [ -u id_user ] id_model

sqexport.pl [ option ...] artefacts -p [ -R | -r id_rvers ] [ --add-measure measure ...] [ -T type ...] [ -L level ] [ -u id_user ] id_project [ id_vers ]

Description

The sqexport.pl script connects to the Squore database and exports data into the CSV format.

This command extracts raw data from the database. That is, it does not read i18n files or model properties to translate strings.

Columns common to the versions and artefacts exports are:

  1. model_id - the database identifier of the model (verbose mode only).

  2. model - the model name.

  3. app_id - the database identifier of the project (verbose mode only).

  4. app_name - the project name.

  5. root_id - the database identifier of the root artefact (verbose mode only).

  6. v_id - the database identifier of the version (verbose mode only).

  7. v_name - the version name.

Users export

These columns are exported:

  1. uid - the database identifier of the user (verbose mode only).

  2. login - the login of the user.

sqexport.pl users [ -r ]

This command exports all user information for all Squore users. The output contains these additional columns:

  1. fullname - the full name of the user.

  2. email - the e-mail of the user.

  3. password - the SHA-1 of the user password, base 64 encoded.

  4. department - the department of the user.

When the -r option is specified, the user profiles are exported instead. The output contains these additional columns:

  1. role_id - the database identifier of the profile (verbose mode only).

  2. role - the profile name of the user.

Groups export

These columns are exported:

  1. gid - the database identifier of the group (verbose mode only).

  2. group - the name of the group.

sqexport.pl groups [ -m ]

This command exports all Squore groups.

When the -m option is used, group members are exported instead. Here are the additional columns in this mode:

  1. uid - the database identifier of the group member (verbose mode only).

  2. login - the login of the group member.

Versions export

These additional columns are exported:

  1. status - the project's version status.

  2. sl_rank - the (numeric) rank of the level of the project.

  3. level - the level of the project.

  4. app_name - The project name.

sqexport.pl versions -m [ -l ] [ -u id_user ] id_model

This form exports all versions of projects that use the model identified by id_model. If -l is used, only the last version of each project is exported.

The id_user is used to restrict output data, using access controls defined in Squore. If not supplied, versions and projects are exported regardless of access control lists.

sqexport.pl versions -p [ -l ] [ -u id_user ] id_project

This form exports all versions of the project identified by id_project. If -l is used, only the last version of the project is exported.

The id_user is used to restrict output data, using access controls defined in Squore. If not supplied, versions and projects are exported regardless of access control lists.

Artefacts export

These additional columns are exported:

  1. art_id - the database identifier of the artefact.

  2. art_path - the path of the artefact.

  3. art_name - the name of the artefact.

  4. type - the type of the artefact.

  5. sl_rank - the (numeric) rank of the level of the artefact.

  6. level - the level of the artefact.

  7. trend - the trend of the artefact, compared to the reference version (with -R or -r only). Values are 'N' for new artefacts, '^' for artefacts that improved, 'v' for artefacts that regressed, and '=' for others.

  8. * - the measure values, as specified with the --add-measure options.

sqexport.pl artefacts -m [ -R ] [ --add-measure measure ...] [ -T type ...] [ -L level ] [ -u id_user ] id_model

Exports all artefacts of the id_model model, eventually filtered out by the -T and -L filters. Both parameters of these options are identifiers of the types and the level, as specified in the model. This is possible to specify types separated by a comma, or multiple -T options. Such types are then OR-ed.

Only artefacts that belong to the last version of projects are exported. If the -R option is set, the trend of levels of artefacts is computed against the last but one version of the projects. By default, there is no trend computation.

Use the --add-measure option to specify the list of measures to add to the output. Use with caution on large result sets.

The id_user is used to restrict output data, using access controls defined in Squore. If not supplied, artefacts are exported, regardless of access control lists.

sqexport.pl artefacts -p [ -R | -r id_rvers ] [ --add-measure measure ...] [ -T type ...] [ -L level ] [ -u id_user ] id_project [ id_vers ]

This form exports artefacts of the id_project project in its id_vers version. If id_vers is not specified, the last version if the project is used. Artefacts may be filtered out with the -T type and -L level options.

The reference version to compute trends of levels of artefacts is either set with -R (use the version right before id_vers), or with -r id_rvers to set an explicit version of the project.

Use the --add-measure option to specify the list of measures to add to the output. Use with caution on large result sets.

The id_user is used to restrict output data, using access controls defined in Squore. If not supplied, artefacts are exported, regardless of access control lists.

Global options

These options are common to all export types.

-h host

Overrides the database host name.

-p port

Overrides the database port number.

-d dbname

Overrides the database name.

-u user

Overrides the database user name.

-f file

Set the CSV output file. If not specified, the output is written to the standard output.

-s sep

Set the CSV separator. Defaults to the ';' character.

-S slices

Specifies a subset of columns to write, starting from 0. The column numbering is computed against the verbose mode, not the standard mode. Separate column numbers with the ',' character.

-v

Turns on the verbose mode. Exports additional columns (mainly internal database ids), and displays some SQL and post processing timings.

Export options

-a

Turns on export at the artefact level.

-m

Turns on export at the model level.

-p

Turns on export at the project level.

-c

Counts entries only, do not list all of them.

-l

Exports the last version of each project only.

-R

Set the reference version for delta or trend computations to the last but one version of the project, from either its last version, or the user supplied version.

-r id_rvers

Set the reference version for delta or trend computations to the version pointed to by the id_rvers.

-T type ...

Filter artefacts of types type, which is the external id of the artefact type, as specified by the model, like APPLICATION, CLASS, FUNCTION, etc. Types may be coma separated.

-L level

Artefacts shall have the level level, which is the external id of the level of performance of a scale, as specified by the model, like LEVELA, LEVELB, etc.

Examples

sqexport.pl artefacts -m -T FILE -L LEVELG 1

This command lists all artefacts of type FILE, that are rated LEVELG. The scope of the search is limited to the artefacts that belong to the model 1, which is its database id. There is no trend computation.

Exit status

0

CSV successfully generated.

2

Syntax or usage error.

*

The script failed. See stderr for an error message.