-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
/** | ||
* @file plugins Sqlite sql insertData.ts | ||
* @description Sqlite 插入数据 sql 语句 | ||
* @author BTMuli <[email protected]> | ||
* @since Alpha v0.2.1 | ||
* @since Beta v0.3.3 | ||
*/ | ||
|
||
// utils | ||
|
@@ -112,22 +111,22 @@ export function insertNameCardData(data: TGApp.App.NameCard.Item): string { | |
|
||
/** | ||
* @description 插入角色数据 | ||
* @since Alpha v0.2.0 | ||
* @since Beta v0.3.3 | ||
* @param {TGApp.User.Character.Item} data 角色数据 | ||
* @returns {string} sql | ||
*/ | ||
export function insertCharacterData(data: TGApp.App.Character.WikiBriefInfo): string { | ||
return ` | ||
INSERT INTO AppCharacters (id, name, star, element, weapon, nameCard, birthday, updated) | ||
VALUES (${data.id}, '${data.name}', ${data.star}, '${data.element}', '${data.weapon}', | ||
'${data.nameCard}', '${data.birthday}', datetime('now', 'localtime')) | ||
'${data.nameCard}', '${data.birthday.toString()}', datetime('now', 'localtime')) | ||
ON CONFLICT(id) DO UPDATE | ||
SET name = '${data.name}', | ||
star = ${data.star}, | ||
element = '${data.element}', | ||
weapon = '${data.weapon}', | ||
nameCard = '${data.nameCard}', | ||
birthday = '${data.birthday}'; | ||
birthday = '${data.birthday.toString()}'; | ||
`; | ||
} | ||
|
||
|