Code coverage reporting
This commit is contained in:
		| @@ -3,6 +3,7 @@ module.exports = async function(db) { | ||||
| 	const contents = db.prepare("SELECT distinct hashed_profile_content FROM sim_member WHERE hashed_profile_content IS NOT NULL").pluck().all() | ||||
| 	const stmt = db.prepare("UPDATE sim_member SET hashed_profile_content = ? WHERE hashed_profile_content = ?") | ||||
| 	db.transaction(() => { | ||||
| 		/* c8 ignore next 6 */ | ||||
| 		for (let s of contents) { | ||||
| 			let b = Buffer.isBuffer(s) ? Uint8Array.from(s) : Uint8Array.from(Buffer.from(s)) | ||||
| 			const unsignedHash = hasher.h64Raw(b) | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/db/orm-defs.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								src/db/orm-defs.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -124,3 +124,4 @@ export type PickTypeOf<T, K extends AllKeys<T>> = T extends { [k in K]?: any } ? | ||||
| export type Merge<U> = {[x in AllKeys<U>]: PickTypeOf<U, x>} | ||||
| export type Nullable<T> = {[k in keyof T]: T[k] | null} | ||||
| export type Numberish<T> = {[k in keyof T]: T[k] extends number ? (number | bigint) : T[k]} | ||||
| export type ValueOrArray<T> = {[k in keyof T]: T[k][] | T[k]} | ||||
|   | ||||
| @@ -8,7 +8,7 @@ const U = require("./orm-defs") | ||||
|  * @template {keyof U.Models[Table]} Col | ||||
|  * @param {Table} table | ||||
|  * @param {Col[] | Col} cols | ||||
|  * @param {Partial<U.Numberish<U.Models[Table]>>} where | ||||
|  * @param {Partial<U.ValueOrArray<U.Numberish<U.Models[Table]>>>} where | ||||
|  * @param {string} [e] | ||||
|  */ | ||||
| function select(table, cols, where = {}, e = "") { | ||||
|   | ||||
| @@ -30,6 +30,11 @@ test("orm: select: all, where and pluck works on multiple columns", t => { | ||||
| 	t.deepEqual(names, ["cadence [they]"]) | ||||
| }) | ||||
|  | ||||
| test("orm: select: in array works", t => { | ||||
| 	const ids = select("emoji", "emoji_id", {name: ["online", "upstinky"]}).pluck().all() | ||||
| 	t.deepEqual(ids, ["288858540888686602", "606664341298872324"]) | ||||
| }) | ||||
|  | ||||
| test("orm: from: get pluck works", t => { | ||||
| 	const guildID = from("guild_space").pluck("guild_id").and("WHERE space_id = ?").get("!jjWAGMeQdNrVZSSfvz:cadence.moe") | ||||
| 	t.equal(guildID, data.guild.general.id) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Cadence Ember
					Cadence Ember