Login

Sqlite resource

RESOURCE
Typing name :  RESOURCE.gws_core.SqliteResource Brick :  gws_core v Parent : 

File class.

/!\ The class that extend file can only have a path and file_store_id attributes. Other attributes will not be provided when creating the resource

Views

rvResourceView.resource_view_spreadsheetVIEW CONTENT - default_view()Default view
Show content of the database
rvResourceView.resource_view_spreadsheetEXECUTE QUERY - execute_select_view()
Show the result of a select query
rvResourceView.resource_view_spreadsheetTABLE NAMES - get_table_names_view()
List the tables of the database
rvResourceView.resource_view_spreadsheetVIEW TABLE - select_table_view()
Show the content of a table

Functions





























__INIT__

Constructor, please do not overwrite this method, use the init method instead Leave the constructor without parameters.

Parameters:
pathstr
ADD_TECHNICAL_INFO

Add a technical information to the resource

Parameters:
technical_infoTechnicalInfo
CHECK_RESOURCE

You can redefine this method to define custom logic to check this resource. If there is a problem with the resource, return a string that define the error, otherwise return None This method is called on output resources of a task. If there is an error returned, the task will be set to error and next proceses will not be run. It is also call when uploading a resource (usually for files or folder), if there is an error returned, the resource will not be uploaded

Return type:
Union[str, NoneType]
CLONE

Clone the resource to create a new instance with a new id It copies the RFields

Return type:
Resource
DETECT_FILE_ENCODING
Parameters:
default_encodingstr
Return type:
str
EXECUTE_SELECT
Parameters:
querystr
Return type:
Table
EXISTS
GET_DEFAULT_NAME

You can redefine this method to set a name of the resource. When saving the resource the name will be saved automatically This can be useful to distinguish this resource from another one or to search for the resource

Return type:
str
GET_DEFAULT_VIEW
Parameters:
pageint
Return type:
View
GET_SIZE
Return type:
int
GET_TABLE_NAMES
Return type:
List
GET_TECHNICAL_INFO

Get the technical information of the resource

Parameters:
keystr
Return type:
TechnicalInfo
GET_VIEW_BY_LINES
Parameters:
start_lineint
Return type:
SimpleTextView
INIT

This can be overwritten to perform custom initialization of the resource. This method is called just after the init (constructor) of the resource. The default values of RFields are set before this method is called.

IS_CSV
IS_EMPTY
Return type:
bool
IS_IMAGE
IS_JPG
IS_JSON
IS_LARGE
IS_PNG
IS_READABLE
Return type:
bool
IS_TXT
OPEN

Open the file

Parameters:
modestr
encodingstr
Return type:
Any
READ
Parameters:
sizeint
Return type:
AnyStr
READ_PART
Parameters:
from_lineint
to_lineint
Return type:
str
SELECT_TABLE
Parameters:
table_namestr
Return type:
Table
WRITE

Write in the file

Parameters:
datastr