![]() However, most content described here are also applicable to Active Record for NoSQL databases. In this tutorial, we will mainly describe the usage of Active Record for relational databases. MongoDB 1.3.0 or later: via yii\mongodb\ActiveRecord, requires the yii2-mongodb extension.Redis 2.6.12 or later: via yii\redis\ActiveRecord, requires the yii2-redis extension.ElasticSearch: via yii\elasticsearch\ActiveRecord, requires the yii2-elasticsearch extensionĪdditionally, Yii also supports using Active Record with the following NoSQL databases:.Sphinx: via yii\sphinx\ActiveRecord, requires the yii2-sphinx extension.The cubrid PDO extension, quoting of values will not work, so you need CUBRID 9.3 as the client as well as the server) CUBRID 9.3 or later: via yii\db\ActiveRecord (Note that due to a bug in.Microsoft SQL Server 2008 or later: via yii\db\ActiveRecord.SQLite 2 and 3: via yii\db\ActiveRecord.PostgreSQL 7.3 or later: via yii\db\ActiveRecord.MySQL 4.1 or later: via yii\db\ActiveRecord.Yii provides the Active Record support for the following relational databases: Intuitive, more error prone, and may even have compatibility problems if you are using a different kind of database: $db->createCommand( 'INSERT INTO `customer` (`name`) VALUES (:name)', [ The above code is equivalent to using the following raw SQL statement for MySQL, which is less Row into the customer table: $customer = new Customer() You can write the following code to insert a new You would access Active Record attributes and call Active Record methods to access and manipulate the data storedįor example, assume Customer is an Active Record class which is associated with the customer tableĪnd name is a column of the customer table. Instance represents the value of a particular column in that row. An Active Record class is associated with a database table,Īn Active Record instance corresponds to a row of that table, and an attribute of an Active Record ![]() Active Record provides an object-oriented interfaceįor accessing and manipulating data stored in databases.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |