@tauri-apps/plugin-sql
Advanced tools
+43
-6
@@ -1,5 +0,42 @@ | ||
| var f=Object.defineProperty;var g=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0});};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i$1=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c);},j=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c); | ||
| /****************************************************************************** | ||
| Copyright (c) Microsoft Corporation. | ||
| var T={};g(T,{Channel:()=>i,PluginListener:()=>o,addPluginListener:()=>l,convertFileSrc:()=>v,invoke:()=>u,transformCallback:()=>_});function _(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}var r,i=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;i$1(this,r,()=>{});this.id=_(n=>{h(this,r).call(this,n);});}set onmessage(n){j(this,r,n);}get onmessage(){return h(this,r)}toJSON(){return `__CHANNEL__:${this.id}`}};r=new WeakMap;var o=class{constructor(n,s,t){this.plugin=n,this.event=s,this.channelId=t;}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,n,s){let t=new i;return t.onmessage=s,u(`plugin:${e}|register_listener`,{event:n,handler:t}).then(()=>new o(e,n,t.id))}async function u(e,n={},s){return window.__TAURI_INTERNALS__.invoke(e,n,s)}function v(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)} | ||
| Permission to use, copy, modify, and/or distribute this software for any | ||
| purpose with or without fee is hereby granted. | ||
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
| REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
| AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
| INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
| LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
| OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
| PERFORMANCE OF THIS SOFTWARE. | ||
| ***************************************************************************** */ | ||
| /* global Reflect, Promise, SuppressedError, Symbol */ | ||
| typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
| var e = new Error(message); | ||
| return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
| }; | ||
| /** | ||
| * Sends a message to the backend. | ||
| * @example | ||
| * ```typescript | ||
| * import { invoke } from '@tauri-apps/api/primitives'; | ||
| * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); | ||
| * ``` | ||
| * | ||
| * @param cmd The command name. | ||
| * @param args The optional arguments to pass to the command. | ||
| * @param options The request options. | ||
| * @return A promise resolving or rejecting to the backend response. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| async function invoke(cmd, args = {}, options) { | ||
| return window.__TAURI_INTERNALS__.invoke(cmd, args, options); | ||
| } | ||
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
@@ -34,3 +71,3 @@ // SPDX-License-Identifier: Apache-2.0 | ||
| static async load(path) { | ||
| const _path = await u("plugin:sql|load", { | ||
| const _path = await invoke("plugin:sql|load", { | ||
| db: path, | ||
@@ -92,3 +129,3 @@ }); | ||
| async execute(query, bindValues) { | ||
| const [rowsAffected, lastInsertId] = await u("plugin:sql|execute", { | ||
| const [rowsAffected, lastInsertId] = await invoke("plugin:sql|execute", { | ||
| db: this.path, | ||
@@ -122,3 +159,3 @@ query, | ||
| async select(query, bindValues) { | ||
| const result = await u("plugin:sql|select", { | ||
| const result = await invoke("plugin:sql|select", { | ||
| db: this.path, | ||
@@ -142,3 +179,3 @@ query, | ||
| async close(db) { | ||
| const success = await u("plugin:sql|close", { | ||
| const success = await invoke("plugin:sql|close", { | ||
| db, | ||
@@ -145,0 +182,0 @@ }); |
+2
-2
| { | ||
| "name": "@tauri-apps/plugin-sql", | ||
| "version": "2.0.0-alpha.2", | ||
| "version": "2.0.0-alpha.3", | ||
| "description": "Interface with SQL databases", | ||
@@ -28,3 +28,3 @@ "license": "MIT or APACHE-2.0", | ||
| "dependencies": { | ||
| "@tauri-apps/api": "2.0.0-alpha.9" | ||
| "@tauri-apps/api": "2.0.0-alpha.11" | ||
| }, | ||
@@ -31,0 +31,0 @@ "scripts": { |
Mixed license
LicensePackage contains multiple licenses.
Found 1 instance in 1 package
18488
1.72%440
7.06%1
Infinity%+ Added
- Removed