Reference

Table Files


Description

No description available

Supported Operations

Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.
Method Supported Reference EndPoint
SELECT list_files
INSERT upload_file
UPDATE update_file
UPSERT
DELETE delete_item
LOOKUP get_file_info

Examples

SSIS

Use Google Drive Connector in API Source component to read data or in API Destination component to read/write data:

Read from Files table using API Source

API Source - Google Drive
Read and write Google Drive data effortlessly. Integrate, manage, and automate files, folders, and shared drives — almost no coding required.
Google Drive
Files
Optional Parameters
Search Criteria mimeType!='application/vnd.google-apps.folder' AND trashed!=true
SSIS API Source - Read from table or endpoint

Read/write to Files table using API Destination

API Destination - Google Drive
Read and write Google Drive data effortlessly. Integrate, manage, and automate files, folders, and shared drives — almost no coding required.
Google Drive
Files
Select
Optional Parameters
Search Criteria mimeType!='application/vnd.google-apps.folder' AND trashed!=true
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

List / search files from my drive

SELECT * FROM Files
WITH(
	--Query='name contains "ZappySys*.*"',
)

List / search files from a single shared drive

SELECT * FROM Files
WITH(
	--Query='name contains "ZappySys*.*"',
	DriveId='0AFWIggplk2z6Uk9PVA',
	DriveType='drive',
	SupportsAllDrives='true',
	IncludeItemsFromAllDrives='true'
)

List / search files from all shared drives

SELECT * FROM Files
WITH(
	--Query='name contains "ZappySys*.*"',
	DriveType='allDrives',
	SupportsAllDrives='true',
	IncludeItemsFromAllDrives='true'
)

List files

SELECT * FROM Files

Update a file

UPDATE Files
WITH(Id='1EVzXFVBQIh3LcJvfcLhI1UWhW3qUxFkM',
     DiskFilePath='C:\MyFiles\myfile.ext')

Delete a file

DELETE FROM Files
WITH(Id='1gcu0hV34OTfgvcu9CFhr7Go4b35j5Mop')

Delete a file by name from a shared drive

DELETE FROM Files
WHERE Name='dump.csv' AND Trashed=0
WITH(DriveId='0AC00HWQH144cUk9PVA', DriveType='drive')

Upload a file with INSERT

INSERT INTO Files
WITH(FileName='My filename',
     DiskFilePath='C:\MyFolder\Mymyfile.ext',
     ParentFolderId='root')

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

List / search files from my drive

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Files
WITH(
	--Query=''name contains "ZappySys*.*"'',
)';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

List / search files from a single shared drive

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Files
WITH(
	--Query=''name contains "ZappySys*.*"'',
	DriveId=''0AFWIggplk2z6Uk9PVA'',
	DriveType=''drive'',
	SupportsAllDrives=''true'',
	IncludeItemsFromAllDrives=''true''
)';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

List / search files from all shared drives

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Files
WITH(
	--Query=''name contains "ZappySys*.*"'',
	DriveType=''allDrives'',
	SupportsAllDrives=''true'',
	IncludeItemsFromAllDrives=''true''
)';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

List files

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Files';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

Update a file

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Files
WITH(Id=''1EVzXFVBQIh3LcJvfcLhI1UWhW3qUxFkM'',
     DiskFilePath=''C:\MyFiles\myfile.ext'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

Delete a file

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Files
WITH(Id=''1gcu0hV34OTfgvcu9CFhr7Go4b35j5Mop'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

Delete a file by name from a shared drive

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Files
WHERE Name=''dump.csv'' AND Trashed=0
WITH(DriveId=''0AC00HWQH144cUk9PVA'', DriveType=''drive'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];

Upload a file with INSERT

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Files
WITH(FileName=''My filename'',
     DiskFilePath=''C:\MyFolder\Mymyfile.ext'',
     ParentFolderId=''root'')';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];