No SQL just objects and instructions, here is an example, SQL would be:
Code: Select all
CREATE TABLE person (
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(100) NOT NULL,
middle_initial CHAR(1),
last_name VARCHAR(100) NOT NULL,
last_contact TIMESTAMP NOT NULL
);Code: Select all
1 from sqlobject import *
2 from datetime import datetime
3
4 class Person(SQLObject):
5
6 firstName = StringCol(length=100)
7 middleInitial = StringCol(length=1, default=None)
8 lastName = StringCol(length=100)
9 lastContact = DateTimeCol(default=datetime.now)The next step we create a class which will hold our table creation.
Finally we create an object oriented methodology where we have variables and values and this can be easily modiied later in the game withtout rewriting all the SQL again. Just reutilizing the object.