User Tools

Site Tools


podoc:count_photos_by_folder_sql_function

This is an old revision of the document!


Database Function Description of "count_photos_by_folder"

Name

count_photos_by_folder

Description

Count the photos in a particular folder.

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

Purpose

To retrieve the number of photos in a particular folder.

Schema

CREATE FUNCTION count_photos_by_folder(INTEGER) RETURNS BIGINT
AS 'select count(identifier) from photo where folder = $1' LANGUAGE 'sql';
CREATE FUNCTION count_photos_by_folder(INTEGER, INTEGER) RETURNS BIGINT
AS 'select count(identifier) from photo where folder = $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_photos_by_folder(INTEGER) RETURNS BIGINT
AS 'select count(identifier) from photo where folder = $1' LANGUAGE 'sql';
CREATE FUNCTION count_photos_by_folder(INTEGER, INTEGER) RETURNS BIGINT
AS 'select count(identifier) from photo where folder = $1 and access_rights <= $2' LANGUAGE 'sql';
podoc/count_photos_by_folder_sql_function.1177338439.txt.gz · Last modified: 2007/04/23 14:27 by Luud