增加晶全app静态页面
This commit is contained in:
1
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Constants.cpp
generated
vendored
Normal file
1
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Constants.cpp
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
#include "Constants.h"
|
||||
50
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Constants.h
generated
vendored
Normal file
50
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Constants.h
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include "sqlite3.h"
|
||||
|
||||
namespace SQLite3
|
||||
{
|
||||
public ref class Datatype sealed
|
||||
{
|
||||
public:
|
||||
static property int Integer { int get() { return SQLITE_INTEGER; } }
|
||||
static property int Float { int get() { return SQLITE_FLOAT; } }
|
||||
static property int Text { int get() { return SQLITE_TEXT; } }
|
||||
static property int Blob { int get() { return SQLITE_BLOB; } }
|
||||
static property int Null { int get() { return SQLITE_NULL; } }
|
||||
};
|
||||
|
||||
public ref class ResultCode sealed
|
||||
{
|
||||
public:
|
||||
static property int Ok { int get() { return SQLITE_OK; } }
|
||||
static property int Error { int get() { return SQLITE_ERROR; } }
|
||||
static property int Internal { int get() { return SQLITE_INTERNAL; } }
|
||||
static property int Perm { int get() { return SQLITE_PERM; } }
|
||||
static property int Abort { int get() { return SQLITE_ABORT; } }
|
||||
static property int Busy { int get() { return SQLITE_BUSY; } }
|
||||
static property int Locked { int get() { return SQLITE_LOCKED; } }
|
||||
static property int NoMem { int get() { return SQLITE_NOMEM; } }
|
||||
static property int ReadOnly { int get() { return SQLITE_READONLY; } }
|
||||
static property int Interrupt { int get() { return SQLITE_INTERRUPT; } }
|
||||
static property int IoErr { int get() { return SQLITE_IOERR; } }
|
||||
static property int Corrupt { int get() { return SQLITE_CORRUPT; } }
|
||||
static property int NotFound { int get() { return SQLITE_NOTFOUND; } }
|
||||
static property int Full { int get() { return SQLITE_FULL; } }
|
||||
static property int CantOpen { int get() { return SQLITE_CANTOPEN; } }
|
||||
static property int Protocol { int get() { return SQLITE_PROTOCOL; } }
|
||||
static property int Empty { int get() { return SQLITE_EMPTY; } }
|
||||
static property int Schema { int get() { return SQLITE_SCHEMA; } }
|
||||
static property int TooBig { int get() { return SQLITE_TOOBIG; } }
|
||||
static property int Constraint { int get() { return SQLITE_CONSTRAINT; } }
|
||||
static property int Mismatch { int get() { return SQLITE_MISMATCH; } }
|
||||
static property int Misuse { int get() { return SQLITE_MISUSE; } }
|
||||
static property int NoLfs { int get() { return SQLITE_NOLFS; } }
|
||||
static property int Auth { int get() { return SQLITE_AUTH; } }
|
||||
static property int Format { int get() { return SQLITE_FORMAT; } }
|
||||
static property int Range { int get() { return SQLITE_RANGE; } }
|
||||
static property int NotADb { int get() { return SQLITE_NOTADB; } }
|
||||
static property int Row { int get() { return SQLITE_ROW; } }
|
||||
static property int Done { int get() { return SQLITE_DONE; } }
|
||||
};
|
||||
}
|
||||
57
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Database.cpp
generated
vendored
Normal file
57
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Database.cpp
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
#include "Winerror.h"
|
||||
|
||||
#include "Database.h"
|
||||
#include "Statement.h"
|
||||
|
||||
namespace SQLite3
|
||||
{
|
||||
Database::Database(Platform::String^ dbPath)
|
||||
: sqlite(nullptr)
|
||||
{
|
||||
int ret = sqlite3_open16(dbPath->Data(), &sqlite);
|
||||
|
||||
if (ret != SQLITE_OK)
|
||||
{
|
||||
sqlite3_close(sqlite);
|
||||
|
||||
HRESULT hresult = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, ret);
|
||||
throw ref new Platform::COMException(hresult);
|
||||
}
|
||||
|
||||
sqlite3_db_config(sqlite, SQLITE_DBCONFIG_DEFENSIVE, 1, NULL);
|
||||
}
|
||||
|
||||
Database::~Database()
|
||||
{
|
||||
if (sqlite != nullptr) sqlite3_close(sqlite);
|
||||
}
|
||||
|
||||
Statement^ Database::Prepare(Platform::String^ sql)
|
||||
{
|
||||
return ref new Statement(this, sql);
|
||||
}
|
||||
|
||||
int Database::closedb()
|
||||
{
|
||||
int rc = sqlite3_close(sqlite);
|
||||
if (rc == SQLITE_OK) sqlite = nullptr;
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Database::close_v2()
|
||||
{
|
||||
int rc = sqlite3_close_v2(sqlite);
|
||||
if (rc == SQLITE_OK) sqlite = nullptr;
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Database::LastInsertRowid()
|
||||
{
|
||||
return sqlite3_last_insert_rowid(sqlite);
|
||||
}
|
||||
|
||||
int Database::TotalChanges()
|
||||
{
|
||||
return sqlite3_total_changes(sqlite);
|
||||
}
|
||||
}
|
||||
28
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Database.h
generated
vendored
Normal file
28
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Database.h
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "sqlite3.h"
|
||||
|
||||
namespace SQLite3
|
||||
{
|
||||
ref class Statement;
|
||||
|
||||
public ref class Database sealed
|
||||
{
|
||||
public:
|
||||
Database(Platform::String^ dbPath);
|
||||
virtual ~Database();
|
||||
|
||||
int closedb();
|
||||
int close_v2();
|
||||
|
||||
Statement^ Prepare(Platform::String^ sql);
|
||||
|
||||
int LastInsertRowid();
|
||||
int TotalChanges();
|
||||
|
||||
private:
|
||||
friend Statement;
|
||||
|
||||
sqlite3* sqlite;
|
||||
};
|
||||
}
|
||||
38
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/SQLite3.Shared.vcxitems
generated
vendored
Normal file
38
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/SQLite3.Shared.vcxitems
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<ItemsProjectGuid>{db84ae51-4b93-44f5-be22-1eae1833ecec}</ItemsProjectGuid>
|
||||
<ItemsRootNamespace>SQLite3</ItemsRootNamespace>
|
||||
<ItemsProjectName>SQLite3.Shared</ItemsProjectName>
|
||||
<CodeSharingProject>248F659F-DAC5-46E8-AC09-60EC9FC95053</CodeSharingProject>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(MSBuildThisFileDirectory)..\..\..\..\node_modules\cordova-sqlite-storage-dependencies</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/DSQLITE_THREADSAFE=1 /DSQLITE_DEFAULT_SYNCHRONOUS=3 /DSQLITE_DEFAULT_MEMSTATUS=0 /DSQLITE_OMIT_DECLTYPE /DSQLITE_OMIT_DEPRECATED /DSQLITE_OMIT_PROGRESS_CALLBACK /DSQLITE_OMIT_SHARED_CACHE /DSQLITE_TEMP_STORE=2 /DSQLITE_OMIT_LOAD_EXTENSION /DSQLITE_ENABLE_FTS3 /DSQLITE_ENABLE_FTS3_PARENTHESIS /DSQLITE_ENABLE_FTS4 /DSQLITE_ENABLE_RTREE /DSQLITE_DEFAULT_PAGE_SIZE=4096 /DSQLITE_OS_WINRT %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\node_modules\cordova-sqlite-storage-dependencies\sqlite3.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Constants.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Database.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Statement.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)Constants.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)Database.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)Statement.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\node_modules\cordova-sqlite-storage-dependencies\sqlite3.c">
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectCapability Include="SourceItemsFromImports" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
268
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/SQLite3.UWP.vcxproj
generated
vendored
Normal file
268
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/SQLite3.UWP.vcxproj
generated
vendored
Normal file
@ -0,0 +1,268 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
- -->
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
- -->
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{76e68196-b7dc-4393-a070-d32fc33bc489}</ProjectGuid>
|
||||
<Keyword>WindowsRuntimeComponent</Keyword>
|
||||
<ProjectName>SQLite3.UWP</ProjectName>
|
||||
<RootNamespace>SQLite3</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
- -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
- -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
||||
<Import Project="SQLite3.Shared.vcxitems" Label="Shared" />
|
||||
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
<ImportGroup Label="Shared" >
|
||||
</ImportGroup>
|
||||
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
- -->
|
||||
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
- -->
|
||||
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
- -->
|
||||
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
- -->
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<AdditionalOptions>/SAFESEH %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<AdditionalOptions>/SAFESEH %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
- -->
|
||||
|
||||
<!-- MOBILE (ARM) NOT SUPPORTED (...)
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
- -->
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
</Project>
|
||||
75
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/SQLite3.sln
generated
vendored
Normal file
75
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/SQLite3.sln
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 14 for Windows
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLite3", "SQLite3", "{F0B5DA26-91CD-44D3-97C8-19B43134837E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.Shared", "SQLite3.Shared.vcxitems", "{DB84AE51-4B93-44F5-BE22-1EAE1833ECEC}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.Windows", "SQLite3.Windows\SQLite3.Windows.vcxproj", "{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.WindowsPhone", "SQLite3.WindowsPhone\SQLite3.WindowsPhone.vcxproj", "{6435C2E4-4FD2-405A-9EE2-5312AE852782}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.UWP", "SQLite3.UWP\SQLite3.UWP.vcxproj", "{76E68196-B7DC-4393-A070-D32FC33BC489}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
SQLite3.Shared.vcxitems*{db84ae51-4b93-44f5-be22-1eae1833ecec}*SharedItemsImports = 9
|
||||
SQLite3.Shared.vcxitems*{d1848fee-6a8e-4ef1-8bfb-8652e5a9cd4a}*SharedItemsImports = 4
|
||||
SQLite3.Shared.vcxitems*{6435c2e4-4fd2-405a-9ee2-5312ae852782}*SharedItemsImports = 4
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Debug|x64.Build.0 = Debug|x64
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Release|ARM.Build.0 = Release|ARM
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Release|Win32.Build.0 = Release|Win32
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Release|x64.ActiveCfg = Release|x64
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}.Release|x64.Build.0 = Release|x64
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Release|ARM.Build.0 = Release|ARM
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Release|Win32.Build.0 = Release|Win32
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782}.Release|x64.ActiveCfg = Release|Win32
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Debug|x64.Build.0 = Debug|x64
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Release|ARM.Build.0 = Release|ARM
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Release|Win32.Build.0 = Release|Win32
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Release|x64.ActiveCfg = Release|x64
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{DB84AE51-4B93-44F5-BE22-1EAE1833ECEC} = {F0B5DA26-91CD-44D3-97C8-19B43134837E}
|
||||
{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A} = {F0B5DA26-91CD-44D3-97C8-19B43134837E}
|
||||
{6435C2E4-4FD2-405A-9EE2-5312AE852782} = {F0B5DA26-91CD-44D3-97C8-19B43134837E}
|
||||
{76E68196-B7DC-4393-A070-D32FC33BC489} = {F0B5DA26-91CD-44D3-97C8-19B43134837E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
90
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Statement.cpp
generated
vendored
Normal file
90
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Statement.cpp
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
#include "Winerror.h"
|
||||
|
||||
#include "Statement.h"
|
||||
#include "Database.h"
|
||||
|
||||
namespace SQLite3
|
||||
{
|
||||
Statement::Statement(Database^ database, Platform::String^ sql)
|
||||
{
|
||||
int ret = sqlite3_prepare16(database->sqlite, sql->Data(), -1, &statement, 0);
|
||||
|
||||
if (ret != SQLITE_OK)
|
||||
{
|
||||
sqlite3_finalize(statement);
|
||||
|
||||
HRESULT hresult = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, ret);
|
||||
throw ref new Platform::COMException(hresult);
|
||||
}
|
||||
}
|
||||
|
||||
Statement::~Statement()
|
||||
{
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
|
||||
int Statement::Step()
|
||||
{
|
||||
return sqlite3_step(statement);
|
||||
}
|
||||
|
||||
int Statement::ColumnCount()
|
||||
{
|
||||
return sqlite3_column_count(statement);
|
||||
}
|
||||
|
||||
int Statement::ColumnType(int index)
|
||||
{
|
||||
return sqlite3_column_type(statement, index);
|
||||
}
|
||||
|
||||
Platform::String^ Statement::ColumnName(int index)
|
||||
{
|
||||
return ref new Platform::String(static_cast<const wchar_t*>(sqlite3_column_name16(statement, index)));
|
||||
}
|
||||
|
||||
Platform::String^ Statement::ColumnText(int index)
|
||||
{
|
||||
return ref new Platform::String(static_cast<const wchar_t*>(sqlite3_column_text16(statement, index)));
|
||||
}
|
||||
|
||||
int Statement::ColumnInt(int index)
|
||||
{
|
||||
return sqlite3_column_int(statement, index);
|
||||
}
|
||||
|
||||
long long Statement::ColumnInt64(int index)
|
||||
{
|
||||
return sqlite3_column_int64(statement, index);
|
||||
}
|
||||
|
||||
double Statement::ColumnDouble(int index)
|
||||
{
|
||||
return sqlite3_column_double(statement, index);
|
||||
}
|
||||
|
||||
int Statement::BindText(int index, Platform::String^ val)
|
||||
{
|
||||
return sqlite3_bind_text16(statement, index, val->Data(), -1, SQLITE_TRANSIENT);
|
||||
}
|
||||
|
||||
int Statement::BindInt(int index, int val)
|
||||
{
|
||||
return sqlite3_bind_int(statement, index, val);
|
||||
}
|
||||
|
||||
int Statement::BindInt64(int index, long long val)
|
||||
{
|
||||
return sqlite3_bind_int64(statement, index, val);
|
||||
}
|
||||
|
||||
int Statement::BindDouble(int index, double val)
|
||||
{
|
||||
return sqlite3_bind_double(statement, index, val);
|
||||
}
|
||||
|
||||
int Statement::BindNull(int index)
|
||||
{
|
||||
return sqlite3_bind_null(statement, index);
|
||||
}
|
||||
}
|
||||
35
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Statement.h
generated
vendored
Normal file
35
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/Statement.h
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "sqlite3.h"
|
||||
|
||||
namespace SQLite3
|
||||
{
|
||||
ref class Database;
|
||||
|
||||
public ref class Statement sealed
|
||||
{
|
||||
public:
|
||||
Statement(Database^ database, Platform::String^ sql);
|
||||
virtual ~Statement();
|
||||
|
||||
int Step();
|
||||
|
||||
int ColumnCount();
|
||||
int ColumnType(int index);
|
||||
Platform::String^ ColumnName(int index);
|
||||
|
||||
Platform::String^ ColumnText(int index);
|
||||
int ColumnInt(int index);
|
||||
long long ColumnInt64(int index);
|
||||
double ColumnDouble(int index);
|
||||
|
||||
int BindText(int index, Platform::String^ val);
|
||||
int BindInt(int index, int val);
|
||||
int BindInt64(int index, long long val);
|
||||
int BindDouble(int index, double val);
|
||||
int BindNull(int index);
|
||||
|
||||
private:
|
||||
sqlite3_stmt* statement;
|
||||
};
|
||||
}
|
||||
1
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/pch.cpp
generated
vendored
Normal file
1
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/pch.cpp
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
#include "pch.h"
|
||||
4
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/pch.h
generated
vendored
Normal file
4
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3/pch.h
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <collection.h>
|
||||
#include <ppltasks.h>
|
||||
294
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3JS/js/SQLite3.js
generated
vendored
Normal file
294
node_modules/cordova-sqlite-storage/src/windows/SQLite3-WinRT-sync/SQLite3JS/js/SQLite3.js
generated
vendored
Normal file
@ -0,0 +1,294 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Statement, Database, ItemDataSource, GroupDataSource;
|
||||
|
||||
// Alternative typeof implementation yielding more meaningful results,
|
||||
// see http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/
|
||||
function type(obj) {
|
||||
var typeString;
|
||||
|
||||
typeString = Object.prototype.toString.call(obj);
|
||||
return typeString.substring(8, typeString.length - 1).toLowerCase();
|
||||
}
|
||||
|
||||
function throwSQLiteError(message, comException) {
|
||||
var error = new Error(message);
|
||||
error.resultCode = comException.number & 0xffff;
|
||||
throw error;
|
||||
}
|
||||
|
||||
Statement = WinJS.Class.define(function (db, sql, args) {
|
||||
try {
|
||||
this.statement = db.connection.prepare(sql);
|
||||
} catch (comException) {
|
||||
throwSQLiteError('Error preparing an SQLite statement.', comException);
|
||||
}
|
||||
|
||||
if (args) {
|
||||
this.bind(args);
|
||||
}
|
||||
}, {
|
||||
bind: function (args) {
|
||||
var index, resultCode;
|
||||
|
||||
args.forEach(function (arg, i) {
|
||||
index = i + 1;
|
||||
switch (type(arg)) {
|
||||
case 'number':
|
||||
if (arg % 1 === 0) {
|
||||
resultCode = this.statement.bindInt64(index, arg);
|
||||
} else {
|
||||
resultCode = this.statement.bindDouble(index, arg);
|
||||
}
|
||||
break;
|
||||
case 'string':
|
||||
resultCode = this.statement.bindText(index, arg);
|
||||
break;
|
||||
case 'null':
|
||||
resultCode = this.statement.bindNull(index);
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unsupported argument type: " + type(arg));
|
||||
}
|
||||
if (resultCode !== SQLite3.ResultCode.ok) {
|
||||
throw new Error("Error " + resultCode + " when binding argument to SQL query.");
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
run: function () {
|
||||
this.statement.step();
|
||||
},
|
||||
one: function () {
|
||||
this.statement.step();
|
||||
return this._getRow();
|
||||
},
|
||||
all: function () {
|
||||
var result = [];
|
||||
|
||||
this.each(function (row) {
|
||||
result.push(row);
|
||||
});
|
||||
return result;
|
||||
},
|
||||
each: function (callback) {
|
||||
var resultCode = this.statement.step();
|
||||
|
||||
while (resultCode === SQLite3.ResultCode.row) {
|
||||
callback(this._getRow());
|
||||
resultCode = this.statement.step();
|
||||
}
|
||||
|
||||
if (resultCode !== SQLite3.ResultCode.done && resultCode !== SQLite3.ResultCode.ok) {
|
||||
throw new Error("SQLite3 step error result code: " + resultCode);
|
||||
}
|
||||
},
|
||||
map: function (callback) {
|
||||
var result = [];
|
||||
|
||||
this.each(function (row) {
|
||||
result.push(callback(row));
|
||||
});
|
||||
return result;
|
||||
},
|
||||
close: function () {
|
||||
this.statement.close();
|
||||
},
|
||||
_getRow: function () {
|
||||
var i, len, name, row = {};
|
||||
|
||||
for (i = 0, len = this.statement.columnCount() ; i < len; i += 1) {
|
||||
name = this.statement.columnName(i);
|
||||
row[name] = this._getColumn(i);
|
||||
}
|
||||
|
||||
return row;
|
||||
},
|
||||
_getColumn: function (index) {
|
||||
switch (this.statement.columnType(index)) {
|
||||
case SQLite3.Datatype.integer:
|
||||
return this.statement.columnInt64(index);
|
||||
case SQLite3.Datatype.float:
|
||||
return this.statement.columnDouble(index);
|
||||
case SQLite3.Datatype.text:
|
||||
return this.statement.columnText(index);
|
||||
case SQLite3.Datatype["null"]:
|
||||
return null;
|
||||
default:
|
||||
throw new Error('Unsupported column type in column ' + index);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Database = WinJS.Class.define(function (dbPath) {
|
||||
try {
|
||||
this.connection = SQLite3.Database(dbPath);
|
||||
} catch (comException) {
|
||||
throwSQLiteError('Error creating an SQLite database connection.', comException);
|
||||
}
|
||||
}, {
|
||||
run: function (sql, args) {
|
||||
var statement = this.prepare(sql, args);
|
||||
|
||||
statement.run();
|
||||
statement.close();
|
||||
},
|
||||
one: function (sql, args) {
|
||||
var row, statement = this.prepare(sql, args);
|
||||
|
||||
row = statement.one();
|
||||
statement.close();
|
||||
return row;
|
||||
},
|
||||
all: function (sql, args) {
|
||||
var rows, statement = this.prepare(sql, args);
|
||||
|
||||
rows = statement.all();
|
||||
statement.close();
|
||||
return rows;
|
||||
},
|
||||
each: function (sql, args, callback) {
|
||||
if (!callback && type(args) === 'function') {
|
||||
callback = args;
|
||||
args = null;
|
||||
}
|
||||
|
||||
var statement = this.prepare(sql, args);
|
||||
|
||||
statement.each(callback);
|
||||
statement.close();
|
||||
},
|
||||
map: function (sql, args, callback) {
|
||||
if (!callback && type(args) === 'function') {
|
||||
callback = args;
|
||||
args = null;
|
||||
}
|
||||
|
||||
var rows, statement = this.prepare(sql, args);
|
||||
|
||||
rows = statement.map(callback);
|
||||
statement.close();
|
||||
return rows;
|
||||
},
|
||||
prepare: function (sql, args) {
|
||||
return new Statement(this, sql, args);
|
||||
},
|
||||
itemDataSource: function (sql, args, keyColumnName, groupKeyColumnName) {
|
||||
if (type(args) === 'string') {
|
||||
groupKeyColumnName = keyColumnName;
|
||||
keyColumnName = args;
|
||||
args = undefined;
|
||||
}
|
||||
|
||||
return new ItemDataSource(this, sql, args, keyColumnName, groupKeyColumnName);
|
||||
},
|
||||
groupDataSource: function (sql, args, keyColumnName, sizeColumnName) {
|
||||
if (type(args) === 'string') {
|
||||
sizeColumnName = keyColumnName;
|
||||
keyColumnName = args;
|
||||
args = undefined;
|
||||
}
|
||||
|
||||
return new GroupDataSource(this, sql, args, keyColumnName, sizeColumnName);
|
||||
},
|
||||
close: function () {
|
||||
return this.connection.closedb();
|
||||
},
|
||||
close_v2: function () {
|
||||
return this.connection.close_v2();
|
||||
},
|
||||
lastInsertRowid: function () {
|
||||
return this.connection.lastInsertRowid();
|
||||
},
|
||||
totalChanges: function () {
|
||||
return this.connection.totalChanges();
|
||||
}
|
||||
});
|
||||
|
||||
ItemDataSource = WinJS.Class.derive(WinJS.UI.VirtualizedDataSource,
|
||||
function (db, sql, args, keyColumnName, groupKeyColumnName) {
|
||||
var dataAdapter = {
|
||||
getCount: function () {
|
||||
var row = db.one('SELECT COUNT(*) AS cnt FROM (' + sql + ')', args);
|
||||
return WinJS.Promise.wrap(row.cnt);
|
||||
},
|
||||
itemsFromIndex: function (requestIndex, countBefore, countAfter) {
|
||||
var items,
|
||||
limit = countBefore + 1 + countAfter,
|
||||
offset = requestIndex - countBefore;
|
||||
|
||||
items = db.map(
|
||||
'SELECT * FROM (' + sql + ') LIMIT ' + limit + ' OFFSET ' + offset,
|
||||
function (row) {
|
||||
var item = {
|
||||
key: row[keyColumnName].toString(),
|
||||
data: row
|
||||
};
|
||||
if (groupKeyColumnName) {
|
||||
item.groupKey = row[groupKeyColumnName].toString();
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
return WinJS.Promise.wrap({
|
||||
items: items,
|
||||
offset: countBefore,
|
||||
atEnd: items.length < limit
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this._baseDataSourceConstructor(dataAdapter);
|
||||
}
|
||||
);
|
||||
|
||||
GroupDataSource = WinJS.Class.derive(WinJS.UI.VirtualizedDataSource,
|
||||
function (db, sql, args, keyColumnName, sizeColumnName) {
|
||||
var groups,
|
||||
dataAdapter,
|
||||
keyIndexMap = {},
|
||||
groupIndex = 0,
|
||||
firstItemIndex = 0;
|
||||
|
||||
groups = db.map(sql, args, function (row) {
|
||||
var item = {
|
||||
key: row[keyColumnName].toString(),
|
||||
groupSize: row[sizeColumnName],
|
||||
firstItemIndexHint: firstItemIndex,
|
||||
data: row
|
||||
};
|
||||
|
||||
keyIndexMap[item.key] = groupIndex;
|
||||
groupIndex += 1;
|
||||
firstItemIndex += item.groupSize;
|
||||
|
||||
return item;
|
||||
});
|
||||
|
||||
dataAdapter = {
|
||||
getCount: function () {
|
||||
return WinJS.Promise.wrap(groups.length);
|
||||
},
|
||||
itemsFromIndex: function (requestIndex, countBefore, countAfter) {
|
||||
return WinJS.Promise.wrap({
|
||||
items: groups.slice(),
|
||||
offset: requestIndex,
|
||||
absoluteIndex: requestIndex,
|
||||
atStart: true,
|
||||
atEnd: true
|
||||
});
|
||||
},
|
||||
itemsFromKey: function (key, countBefore, countAfter) {
|
||||
return this.itemsFromIndex(keyIndexMap[key], countBefore, countAfter);
|
||||
}
|
||||
};
|
||||
|
||||
this._baseDataSourceConstructor(dataAdapter);
|
||||
}
|
||||
);
|
||||
|
||||
WinJS.Namespace.define('SQLite3JS', {
|
||||
Database: Database
|
||||
});
|
||||
|
||||
}());
|
||||
174
node_modules/cordova-sqlite-storage/src/windows/sqlite-proxy.js
generated
vendored
Normal file
174
node_modules/cordova-sqlite-storage/src/windows/sqlite-proxy.js
generated
vendored
Normal file
@ -0,0 +1,174 @@
|
||||
var dbmap = {};
|
||||
|
||||
var nextTick = window.setImmediate || function(fun) {
|
||||
window.setTimeout(fun, 0);
|
||||
};
|
||||
|
||||
/* **
|
||||
function handle(p, win, fail) {
|
||||
if (p)
|
||||
p.done(
|
||||
function (res) {
|
||||
if (res[1])
|
||||
fail(res[1]);
|
||||
else
|
||||
win(res[0]?JSON.parse(res[0]):[]);
|
||||
},
|
||||
function (err) {
|
||||
fail(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
// */
|
||||
|
||||
module.exports = {
|
||||
echoStringValue: function(win, fail, args) {
|
||||
var options = args[0];
|
||||
win(options.value);
|
||||
},
|
||||
open: function(win, fail, args) {
|
||||
var options = args[0];
|
||||
var res;
|
||||
|
||||
function openImmediate(dbname) {
|
||||
if (!!dbmap[dbname]) {
|
||||
// NO LONGER EXPECTED due to BUG 666 workaround solution:
|
||||
fail("INTERNAL ERROR: database already open for dbname: " + dbname);
|
||||
}
|
||||
|
||||
// from @EionRobb / phonegap-win8-sqlite:
|
||||
var opendbname = Windows.Storage.ApplicationData.current.localFolder.path + "\\" + dbname;
|
||||
console.log("open db name: " + dbname + " at full path: " + opendbname);
|
||||
|
||||
var db = new SQLite3JS.Database(opendbname);
|
||||
dbmap[dbname] = db;
|
||||
nextTick(function() {
|
||||
win();
|
||||
});
|
||||
//res = SQLitePluginRT.SQLitePlugin.openAsync(options.name);
|
||||
}
|
||||
|
||||
try {
|
||||
//res = SQLitePluginRT.SQLitePlugin.openAsync(options.name);
|
||||
var dbname = options.name;
|
||||
|
||||
openImmediate(dbname);
|
||||
} catch(ex) {
|
||||
//fail(ex);
|
||||
nextTick(function() {
|
||||
fail(ex);
|
||||
});
|
||||
}
|
||||
//handle(res, win, fail);
|
||||
},
|
||||
close: function(win, fail, args) {
|
||||
var options = args[0];
|
||||
var res;
|
||||
try {
|
||||
var dbname = options.path;
|
||||
|
||||
nextTick(function() {
|
||||
var rc = 0;
|
||||
var db = dbmap[dbname];
|
||||
|
||||
if (!db) {
|
||||
fail("CLOSE ERROR: cannot find db object for dbname: " + dbname);
|
||||
} else if ((rc = db.close()) !== 0) {
|
||||
fail("CLOSE ERROR CODE: " + rc);
|
||||
} else {
|
||||
delete dbmap[dbname];
|
||||
win();
|
||||
}
|
||||
});
|
||||
} catch (ex) {
|
||||
fail(ex);
|
||||
}
|
||||
},
|
||||
backgroundExecuteSqlBatch: function(win, fail, args) {
|
||||
var options = args[0];
|
||||
var dbname = options.dbargs.dbname;
|
||||
var executes = options.executes;
|
||||
var db = dbmap[dbname];
|
||||
var results = [];
|
||||
var i, count=executes.length;
|
||||
|
||||
//console.log("executes: " + JSON.stringify(executes));
|
||||
//console.log("execute sql count: " + count);
|
||||
for (i=0; i<count; ++i) {
|
||||
var e = executes[i];
|
||||
//console.log("execute sql: " + e.sql + " params: " + JSON.stringify(e.params));
|
||||
try {
|
||||
var oldTotalChanges = db.totalChanges();
|
||||
var rows = db.all(e.sql, e.params);
|
||||
//console.log("got rows: " + JSON.stringify(rows));
|
||||
var rowsAffected = db.totalChanges() - oldTotalChanges;
|
||||
var result = { rows: rows, rowsAffected: rowsAffected };
|
||||
if (rowsAffected > 0) {
|
||||
var lastInsertRowid = db.lastInsertRowid();
|
||||
if (lastInsertRowid !== 0) result.insertId = lastInsertRowid;
|
||||
}
|
||||
results.push({
|
||||
type: "success",
|
||||
result: result
|
||||
});
|
||||
} catch(ex) {
|
||||
console.log("sql exception error: " + ex.message);
|
||||
results.push({
|
||||
type: "error",
|
||||
result: { message: ex.message, code: 0 }
|
||||
});
|
||||
}
|
||||
}
|
||||
//console.log("return results: " + JSON.stringify(results));
|
||||
nextTick(function() {
|
||||
//console.log("return results: " + JSON.stringify(results));
|
||||
win(results);
|
||||
});
|
||||
},
|
||||
"delete": function(win, fail, args) {
|
||||
var options = args[0];
|
||||
var res;
|
||||
try {
|
||||
//res = SQLitePluginRT.SQLitePlugin.deleteAsync(JSON.stringify(options));
|
||||
var dbname = options.path;
|
||||
|
||||
WinJS.Application.local.exists(dbname).then(function(isExisting) {
|
||||
if (!isExisting) {
|
||||
// XXX FUTURE TBD consistent for all platforms:
|
||||
fail("file does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!!dbmap[dbname]) {
|
||||
dbmap[dbname].close_v2();
|
||||
|
||||
delete dbmap[dbname];
|
||||
}
|
||||
|
||||
//console.log('test db name: ' + dbname);
|
||||
Windows.Storage.ApplicationData.current.localFolder.getFileAsync(dbname)
|
||||
.then(function (dbfile) {
|
||||
//console.log('get db file to delete ok');
|
||||
return dbfile.deleteAsync(Windows.Storage.StorageDeleteOption.permanentDelete);
|
||||
}, function (e) {
|
||||
console.log('get file failure: ' + JSON.stringify(e));
|
||||
// XXX FUTURE TBD consistent for all platforms:
|
||||
fail(e);
|
||||
}).then(function () {
|
||||
//console.log('delete ok');
|
||||
win();
|
||||
}, function (e) {
|
||||
console.log('delete failure: ' + JSON.stringify(e));
|
||||
// XXX FUTURE TBD consistent for all platforms:
|
||||
fail(e);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
} catch(ex) {
|
||||
fail(ex);
|
||||
}
|
||||
//handle(res, win, fail);
|
||||
}
|
||||
};
|
||||
require("cordova/exec/proxy").add("SQLitePlugin", module.exports);
|
||||
Reference in New Issue
Block a user