⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usage_update_delete_persistents.txt

📁 LiteSQL is a C++ library that integrates C++ objects tightly to relational database and thus provide
💻 TXT
字号:
/* LiteSQL - Documentation *  * By Tero Laitinen  *  * See LICENSE for copyright information. *//* \file documentation.txt    Manual *//** \page usage_update_delete_persistents Storing and Deleting PersistentsA simple Person database:\code<?xml version="1.0"?><!DOCTYPE database SYSTEM "litesql.dtd"><database name="PersonDatabase">    <object name="Person">        <field name="name" type="string"/>        <field name="age" type="integer"/>    </object></database>\endcodeFollowing code demonstrates how to insert Persons to database:\codePersonDatabase db("sqlite3", "database=person.db"); // assumes the database has been createdPerson person(db); // construct Person, does not write anything to databaseperson.name = "Bob"; // assign values to fieldsperson.age = 20;person.update(); // writes a new record to databaseperson.age = 21; // Bob got just olderperson.update(); // updates old recordperson.id = 100; // force internal identifier (id) to 100 person.update(); // updates old record\endcodeNote: if internal identifier (id-field) is changed, relations will not "follow"the object and will not be deleted either. If the object is not replaced withanother object, relations should be manually dropped using delRelations-method.Following code demonstrates how to delete Persons from database:\codePerson person = select<Person>(db).one(); // any Person will doperson.del(); // person.onDelete() gets called before data is deleted\endcode*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -