🛠️ Code cleanup & added many new features #1
@ -1,6 +1,9 @@
|
|||||||
package de.gnmyt.SQLToolkit.storage;
|
package de.gnmyt.SQLToolkit.storage;
|
||||||
|
|
||||||
import de.gnmyt.SQLToolkit.drivers.MySQLConnection;
|
import de.gnmyt.SQLToolkit.drivers.MySQLConnection;
|
||||||
|
import de.gnmyt.SQLToolkit.manager.DataBaseSelection;
|
||||||
|
import de.gnmyt.SQLToolkit.manager.InsertManager;
|
||||||
|
import de.gnmyt.SQLToolkit.manager.UpdateManager;
|
||||||
import de.gnmyt.SQLToolkit.types.SQLType;
|
import de.gnmyt.SQLToolkit.types.SQLType;
|
||||||
import de.gnmyt.SQLToolkit.types.TableField;
|
import de.gnmyt.SQLToolkit.types.TableField;
|
||||||
|
|
||||||
@ -113,6 +116,30 @@ public abstract class SQLTable {
|
|||||||
custom(new TableField(name, type, length, allowNull, defaultValue).setExtra(extras));
|
custom(new TableField(name, type, length, allowNull, defaultValue).setExtra(extras));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the database selection from the current the table
|
||||||
|
* @return the database selection
|
||||||
|
*/
|
||||||
|
public DataBaseSelection select() {
|
||||||
|
return connection.selectFrom(tableName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the update manager of the current table
|
||||||
|
* @return the update manager
|
||||||
|
*/
|
||||||
|
public UpdateManager update() {
|
||||||
|
return connection.updateTable(tableName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the insert manager of the current table
|
||||||
|
* @return the insert manager
|
||||||
|
*/
|
||||||
|
public InsertManager insert() {
|
||||||
|
return connection.insertTo(tableName());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a table field to the table
|
* Adds a table field to the table
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user