2022-08-21 00:40:49 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2024-04-26 17:32:25 +02:00
|
|
|
<class name="DatabaseManager" inherits="Object" version="4.4">
|
2022-08-21 00:40:49 +02:00
|
|
|
<brief_description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Database Manager Singleton.
|
2022-08-21 00:40:49 +02:00
|
|
|
</brief_description>
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Database Manager Singleton.
|
|
|
|
Stores database connections that need to be accessible throughout the application.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
<tutorials>
|
|
|
|
</tutorials>
|
|
|
|
<methods>
|
|
|
|
<method name="add_database">
|
|
|
|
<return type="void" />
|
|
|
|
<argument index="0" name="db" type="Database" />
|
|
|
|
<argument index="1" name="set_as_default" type="bool" default="true" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Add a Database. If [code]set_as_default[/code] is true it will be set as default, which means it will be set to the [member ddb] property.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="get_database">
|
|
|
|
<return type="Database" />
|
|
|
|
<argument index="0" name="index" type="int" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Returns a Database.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="get_database_count">
|
|
|
|
<return type="int" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Returns how many databases are stored in the singleton.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="get_databases">
|
|
|
|
<return type="Array" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Returns all Databases.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
2022-12-27 14:52:04 +01:00
|
|
|
<method name="initialized">
|
|
|
|
<return type="void" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Calls the [code]initialized[/code] signal.
|
2022-12-27 14:52:04 +01:00
|
|
|
</description>
|
|
|
|
</method>
|
2022-08-21 00:40:49 +02:00
|
|
|
<method name="load">
|
|
|
|
<return type="void" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Not implemented currently. Will likely load databases from ProjectSettings.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="migrate">
|
|
|
|
<return type="void" />
|
|
|
|
<argument index="0" name="clear" type="bool" />
|
|
|
|
<argument index="1" name="should_seed" type="bool" />
|
|
|
|
<argument index="2" name="pseed" type="int" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Calls the [member migration] signal.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="remove_database">
|
|
|
|
<return type="void" />
|
|
|
|
<argument index="0" name="index" type="int" />
|
|
|
|
<argument index="1" name="unset_if_default" type="bool" default="true" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Removes a Database.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
</methods>
|
|
|
|
<members>
|
|
|
|
<member name="ddb" type="Database" setter="set_ddb" getter="get_ddb">
|
2024-04-27 23:03:18 +02:00
|
|
|
The default database.
|
2022-08-21 00:40:49 +02:00
|
|
|
</member>
|
|
|
|
</members>
|
|
|
|
<signals>
|
|
|
|
<signal name="database_added">
|
|
|
|
<argument index="0" name="db" type="Database" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Emitted when a [Database] is added.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</signal>
|
|
|
|
<signal name="database_removed">
|
|
|
|
<argument index="0" name="db" type="Database" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Emitted when a [Database] is removed.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</signal>
|
|
|
|
<signal name="default_database_changed">
|
|
|
|
<argument index="0" name="db" type="Database" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Emitted when default database is changed.
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</signal>
|
2022-12-27 14:52:04 +01:00
|
|
|
<signal name="initialized">
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Can be emitted using the [member initialized] method after the database connections are set up.
|
2022-12-27 14:52:04 +01:00
|
|
|
</description>
|
|
|
|
</signal>
|
2022-08-21 00:40:49 +02:00
|
|
|
<signal name="migration">
|
|
|
|
<argument index="0" name="clear" type="bool" />
|
|
|
|
<argument index="1" name="should_seed" type="bool" />
|
|
|
|
<argument index="2" name="pseed" type="int" />
|
|
|
|
<description>
|
2024-04-27 23:03:18 +02:00
|
|
|
Can be emitted using the [member migrate] method when the databse structure needs to be updated (or created).
|
2022-08-21 00:40:49 +02:00
|
|
|
</description>
|
|
|
|
</signal>
|
|
|
|
</signals>
|
|
|
|
<constants>
|
|
|
|
</constants>
|
|
|
|
</class>
|