菜鸟刚来学js,问一下大大们,类是怎么回事?
我在一个文档里面看到了下面一些内容,我应该怎么使用这个类和,类的方法啊??Module ejs.db
Namespace "ejs.db"
Definition class Database
Inheritance Database Object
Database Methods
public addColumn(table: String, column: String, datatype: String, options: Object): Void
Add a column to a table.
public addIndex(table: String, column: String, index: String): Void
Add an index on a column.
public changeColumn(table: String, column: String, datatype: String, options: Object): Void
Change a column.
public close(): Void
Close the database connection.
public commit(): Void
Commit a database transaction.
public connect(connectionString: String): Void
Reconnect to the database using a new connection string.
public get connection(): String
Get the database connection string.
public createDatabase(name: String, options: Object): Void
Create a new database.
public createTable(table: String, columns: Array): Void
Create a new table.
Database(adapter: String, connectionString: String)
Initialize a database connection using the supplied database connection string.
public dataTypeToSqlType(dataType: String): String
Map the database independant data type to a database dependant SQL data type.
public static get defaultDatabase(): Database
Get the default database for the application.
public static set defaultDatabase(db: Database): Void
Set the default database for the application.
public destroyDatabase(name: String): Void
刚学没多久,不太懂,还望大家多多点拨