User Tools

Site Tools


podoc:count_folders_by_user_sql_function

Database Function Description of "count_folders_by_user"

Name

count_folders_by_user

Description

Count the total number of folders of a particular user.

There are two versions, one that counts all folders and one that counts only those folders up to a given access rights setting.

Purpose

To retrieve the total number of folders of a particular user.

Schema

CREATE FUNCTION count_folders_by_user(INTEGER) RETURNS BIGINT
AS 'select count(identifier) from folder where users = $1' LANGUAGE 'sql';
CREATE FUNCTION count_folders_by_user(INTEGER, INTEGER) RETURNS BIGINT
AS 'select count(identifier) from folder where users = $1 and access_rights <= $2' LANGUAGE 'sql';

History

Used first

Version 2.5

Used last

Still in use

Change history

= Version 2.5 =

CREATE FUNCTION count_folders_by_user(INTEGER) RETURNS BIGINT
AS 'select count(identifier) from folder where users = $1' LANGUAGE 'sql';
CREATE FUNCTION count_folders_by_user(INTEGER, INTEGER) RETURNS BIGINT
AS 'select count(identifier) from folder where users = $1 and access_rights <= $2' LANGUAGE 'sql';
podoc/count_folders_by_user_sql_function.txt · Last modified: 2007/04/23 10:26 by Luud