Drive.File

Type

Read/write

Author

Availability

Data provider

Read

Finbourne

Provided with LUSID

The Drive.File provider enables you to write a Luminesce query that searches for a particular file or files stored in Drive.

Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and enumerate target files and folders in Drive. This should automatically be the case if you are the domain owner.

The query returns a table of data if matching files are found, which you can use in preparation for extracting data from those files.

See also: Drive.Excel, Drive.Csv, Drive.Sqlite, Drive.SaveAs

Basic usage

select * from Drive.File where <filter-expression>; 

Query parameters

Drive.File has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Drive.File' and FieldType = 'Parameter';

Data fields

By default, Drive.File returns a table of data populated with particular fields (columns). You can return just a subset of these fields if you wish.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Drive.File' and FieldType = 'Column';

Note: Fields marked 'main' are returned by queries that start select ^ from Drive.File...

Examples

Note: For more examples, try the Luminesce Github repo.

Example 1: List the files and folders in the root Drive directory

select * from Drive.File

Example 2: List all the files and folders in a particular folder

select * from Drive.File where RootPath = 'trade-files'

Example 3: List all the files and folders in a folder and its subfolders to a particular depth

select * from Drive.File where RootPath = 'trade-files' and RecurseDepth = 2

Example 4: List all the files in a folder that have a similar name

select * from Drive.File where Name like 'trade-file-%-eod'