Skip to content

EasyColumn

Ashenguard edited this page May 9, 2022 · 4 revisions

Notes:

You can check the source here
Arguments with [O] before the name are optional and not passing them will not cause any issues.
Arguments with [R] before the name are required and not passing them will cause python to raise an exception.
Arguments with [D <value>] before the name have default values that will be used if you do not pass them, But it is not guaranteed there will be no exceptions.
Arguments with [E <value>] before the name have default values but the value will cause an exception.
The STC-<Version> Methods/Properties are subjects to be changed or are depressed and might get removed in the specified version. If no version is specified it means there is no solid plan.
The PUO Methods/Properties are for Private use only which you won't need to use yourself, They just exist for other classes to use.

Initializing

To initialize the class you need to pass the following arguments:

  • [R] name: The name of the column
  • [R] sql_type: The type this column has, must be one of SQLTypes available
  • [O] default: The default value if it is not defined while inserting data, If None is provided as default it will use the default SQLType provides
  • [O] primary: If the column is the primary column of the table, Only one per table is allowed
  • [O] not_null: If the column must have a value unless it raises an exception, The built-in feature of SQLType normally prevents the exception
  • [O] auto_increment: If the value should increase itself as SQL intended to

get_sql

[PUO]
A method that will provide a SQL syntax based on what is defined.

parse

[PUO]
A method that will arrange the syntax of your variable for SQL commands.

cast

[PUO]
A method that will cast the value received to a proper format and return it.

Clone this wiki locally