bin/SnsSqlitePsModule.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>SnsSqlitePsModule</name>
    </assembly>
    <members>
        <member name="T:SnsSqlitePsModule.BackupSnsSqliteDataBase">
            <summary>
            <para type="synopsis">
                Connects To A Specified SQLite DataBase Called Source DataBase Or Source For Short, Creates Another SQLite
                DataBase Called Destination Or Backup For Short, Connects To Destination DataBase And Copy The Whole Content From
                The Source Into The Destination DataBase.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
               Connects To A Specified SQLite DataBase Called Source DataBase Or Source For Short, Creates Another SQLite
               DataBase Called Destination Or Backup For Short, Connects To Destination DataBase And Copy The Whole Content From
               The Source Into The Destination DataBase.
            </para>
            <para type="description">
               Since The DataBase Backup Is Relatively Simple Process Initially I Had No Intention To Create Such CmdLet At All.
               However It Turned Out That It Requires Handling Of Multiple Exceptions. So This CmdLet Was Developed To Prevent
               The Exceptions Managing Over And Over Again.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                Before The Actual Backup The CmdLet Verifies The Source DataBase Existence And Whether Successful Writable (Not
                Read Only) Connection Can Be Established. Afterward The CmdLet Verifies The Backup File Existence, In Case It
                Exists Is Thrown Termination Error. In Case Force Switch Parameter Is Used The CmdLet Will Try To Delete The
                Destination DataBase File. Then New Blank Destination DataBase Is Created And It Is Verified Whether Writable
                Connection Can Be Established. In Case Both Connections Are Opened Successfully The CmdLet Performs Backup.
            </para>
            <para type="description">
                Whenever The Destination DataBase Is Not Specified, The CmdLet Will Create The Backup DataBase In The Same Folder
                As The Source DataBase With Name The Same As The Source Prefixed With Digits Representing The Current UTC Date And
                Time.
            </para>
            <para type="description">
                Whenever For Destination Is Specified A Folder, And That Folder Is Not The Folder Where The Source DataBase Is
                Located, The CmdLet Will Place The Backup DataBase Into The Specified Folder With Name Matching The Source
                DataBase Name.
            </para>
            <para type="description">
                Whenever For Destination Is Specified Filename, The CmdLet Will Create The Backup DataBase With The Specified Name
                And Will Place It In The Current Working Folder.
            </para>
            <para type="description">
                Whenever For Destination Is Specified Full Absolute File Path The Destination DataBase Will Be Created With The
                Specified Name In The Specified Location.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <list type="alertSet">
                <item>
                    <term> </term>
                    <description>
                        <para>AUTHOR: Svetoslav Nedyalkov Savov</para>
                        <para>THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK</para>
                        <para>OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.</para>
                        <para></para>
                        <para></para>
                        <para></para>
                    </description>
                </item>
            </list>
            <example>
              <code>
                Backup-SnsSqliteDataBase -DataBase "temp.db";
              </code>
              <para> </para>
              <para>
                Backups DataBase "temp.db" Into A New DataBase Located In The Current Folder With The Same Name Prefixed With
                Digits Representing Current UTC Date And Time.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                Backup-SnsSqliteDataBase -DataBase "temp.db" -Destination "C:\Backups";
              </code>
              <para> </para>
              <para>
                Backups DataBase "temp.db" Into "C:\Backup\temp.db".
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                Backup-SnsSqliteDataBase -DataBase "temp.db" -Destination "backup.db";
              </code>
              <para> </para>
              <para>
                Backups DataBase "temp.db" Into "backup.db" Both Located In The Current Working Folder.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                Backup-SnsSqliteDataBase -DataBase "temp.db" -Destination "C:\Backups\backup.db";
              </code>
              <para> </para>
              <para>
                Backups DataBase "temp.db" Into "C:\Backups\backup.db".
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            </summary>
            <para type="link" uri="https://github.com/svesavov/SnsSqlitePsModule"> svesavov / SnsSqlitePsModule - </para>
            <para type="link" uri="https://www.powershellgallery.com/packages/SnsSqlitePsModule/"> PowerShell Gallery - </para>
            <para type="link" uri="https://www.linkedin.com/in/svetoslavsavov"> Svetoslav Savov on LinkedIn - </para>
            <para type="link" uri="https://github.com/RamblingCookieMonster/PSSQLite"> RamblingCookieMonster / PSSQLite - </para>
            <para type="link" uri="https://sqlite.org/index.html"> SQLite V3 - </para>
            <para type="link" uri="https://www.sqlite.org/datatype3.html"> SQLite V3 Data Types - </para>
            <para type="link" uri="https://www.sqlite.org/lang.html"> SQLite V3 Supported SQL Syntax - </para>
            <para type="link" uri="http://www.sqlite.org/pragma.html"> SQLite V3 Pragma Statements - </para>
            <para type="link" uri="https://www.sqlitetutorial.net/"> SQLite V3 Tutorials - </para>
            <para type="link" uri="https://github.com/pawelsalawa/sqlitestudio/releases"> SQLite Studio - </para>
        </member>
        <member name="P:SnsSqlitePsModule.BackupSnsSqliteDataBase.DataBase">
            <summary>
            <para type="description">Specifies SQLite DataBase File To Be Backed Up.</para>
            <para type="description">Accepts Either File Name Or Full Absolute UNC Path.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.BackupSnsSqliteDataBase.Destination">
            <summary>
            <para type="description">Specifies The Backup File Or The Backup Folder.</para>
            <para type="description">Accepts Either File Name Or Full Absolute UNC Path.</para>
            <para type="description">If Not Provided The CmdLet Will Generate One Based On UTC Time And Source DataBase.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.BackupSnsSqliteDataBase.Force">
            <summary>
            <para type="description">Specifies To Delete The Destination File Upfront If It Already Exists.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.BackupSnsSqliteDataBase.PassThru">
            <summary>
            <para type="description">Specifies To Revert Output.</para>
            <para type="description">If Backup DataBase Size In Bytes Equals Source DataBase Will Revert The Backup FilePath.</para>
            <para type="description">If Backup DataBase Size In Bytes Not Equals Source DataBase Will String "Backup Failed".</para>
            </summary>
        </member>
        <member name="T:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert">
            <summary>
            <para type="synopsis">
                Imports Collection Of Object Into Specified Table Within Specified SQLite DataBase.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                Imports Collection Of Object Into Specified Table Within Specified SQLite DataBase.
            </para>
            <para type="description">
                This CmdLet Does Allow Users Without Or With Limited Knowledge About SQL Query Language To Work With DataBases.
                The CmdLet Creates The SQL Query And The SQL Parameters On Its Own. The User Has No Need Even To Know What SQL
                Injection Is And How To Avoid It.
            </para>
            <para type="description">
                There Are Cases When We Have Large Collections Of Similar Objects That Corresponds Exactly To Specific Table In A
                DataBase And We Need To Insert Them At Once Taking The Advantage Of The SQL Transactions. This CmdLet Is Made
                Exactly For Those Cases. Like For Example We Need To Insert The Information About All Users In The Environment
                Into A DataBase Table Named Users. Then We Simply Query The Active Directory About All Users And Pipeline The
                Output To This CmdLet.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                The CmdLet Have Two ParameterSets Which Represent The Allowed Combination Of Input Parameters.
            </para>
            <para type="description">
                Those ParameterSets Allows Either DataBase File To Be Specified Along With Parameters Used To Establish A
                Connection To It, Or To Be Specified SQLiteConnection Object Associated With An Existing Connection. The CmdLet
                Performs SQL INSERT Queries Therefore ReadOnly SQLConnection Is Not Allowed.
            </para>
            <para type="description">
                The Specified Input Is Verified Either At The Parameters Section Or Within The Begin Method. Some Of The Input Is
                Verified Several Times With Various Verifications, As For Example The Table Name Is Verified Once Whether It
                Contains Non Alphanumeric Characters And Second Time Whether It Exists Inside The Specified DataBase. The CmdLet
                Can Handle INSERT Queries Only In Existing Data Sources With Existing Tables, Unlike The Rest Of The CmdLets
                Within This PowerShell Module Which Normally Would Create The Missing DataBase.
            </para>
            <para type="description">
                The CmdLet Establishes SQL Connection At The Beginning Method And Query The DataBase About A List With The
                Existing Tables. In Case The Specified Table Exists It Query The DataBase Second Time About Tables Schema. The
                Retrieved Table Schema Is Used For The SQL Query Auto Initialization And The Enumeration Of The SQL Parameter
                Names.
            </para>
            <para type="description">
                Because There Are Lot Faster Built Into SQLite Ways For Bulk Insert Data Within A Table, This CmdLet Most Likely
                Will Be Used In Automations Running On A Schedule.
            </para>
            <para type="description">
                Whenever Initial Or One Time Data INSERT Is Required I Recommend The Manual Approach Using The Official SQLite
                Tools CLI https://www.sqlite.org/download.html Or SQLite Studio
                https://github.com/pawelsalawa/sqlitestudio/releases. Manual Approach Allows Greater Visibility. Using Graphical
                Interface For One Time Actions Is Always Better.
            </para>
            <para type="description">
                To Avoid SQL Injection Issues The CmdLet Converts Each Of The Provided InputObjects To SQL Parameters And Auto
                Enumerates The SQL Query And Its SQL Variables From The Enumerated Table Columns. This Introduces Additional
                Requirements:
            </para>
            <para type="description">
                - The Column Names In The Destination Table Must Contain Only Lower And Capital English Letters, Digits And
                Underscore (_) Character.
            </para>
            <para type="description">
                - The Input Objects Property Names Must Match Exactly The Destination Table Column Names.
            </para>
            <para type="description">
                - The Types Of The Values Inside The Input Objects Properties Must Match Exactly The Corresponding Destination
                Table Column Data Types.
            </para>
            <para type="description">
                - The Values Inside The Input Objects Properties Must Be Normalized In Advance.
            </para>
            <para type="description"> </para>
            <para type="description">
                - Whenever The Input Objects Have Properties Not Present In The Destination Table Schema, Their Values Will Be
                Ignored.
            </para>
            <para type="description">
                - Whenever The Input Objects Have No Properties Present In The Destination Table Schema, The CmdLet Will Insert
                NULL In The Corresponding Columns. This Might Lead To SQL Errors Whenever Those Columns Have NOT NULL Constraint.
            </para>
            <para type="description">
                Whenever Those Requirements Cannot Be Met The User Still Can Use Invoke-SnsSqliteQuery For Bulk Operations Which
                Does Provide More Control Over The Process But Requires More In-Depth SQL Query Language Knowledge.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                To Simplify The Dates Managing The Module Offers Predefined Formatting Strings To Convert DateTime Object To
                Understandable For SQLite Format. Although The CmdLet Will Process SQL Parameters Date Values Without Being
                Converted Upfront To Strings.
            </para>
            <para type="description">
                Leaving The DateTime Objects To Be Automatically Managed Might Lead To Unexpected Results Related With The
                DateTime Syntax Coming From The Regional Settings On The Machine, Daylight Saving Related And TimeZone Related
                Issues. From That Perspective I Would Recommend The Dates To Be Normalized To Long Integer And To Be Stored In
                Numeric Columns.
            </para>
            <para type="description">
                [System.DateTime]::Now.ToFileTime() - Gets The System DateTime And Converts It To Long Integer.
            </para>
            <para type="description">
                [System.DateTime]::FromFileTime(108666144000000000) - Converts The Long Integer To Local DateTime With Time Zone
                And Daylight Saving Taken Into Consideration.
            </para>
            <para type="description">
                [System.DateTime]::FromFileTimeUtc(108666144000000000) - Converts The Long Integer To Universal DateTime. (Guess
                What Is The Date From The Example).
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <list type="alertSet">
                <item>
                    <term> </term>
                    <description>
                        <para>AUTHOR: Svetoslav Nedyalkov Savov</para>
                        <para>THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK</para>
                        <para>OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.</para>
                        <para></para>
                        <para></para>
                        <para></para>
                    </description>
                </item>
            </list>
            <example>
              <code>
                Invoke-SnsSqliteObjectInsert -DataBase "C:\temp.sqlite" -Table "MyTable" -InputObject $arrInputy;
              </code>
              <para> </para>
              <para>
                Converts The Specified InputObjects Collection To SQL Parameters And Insert The Data Into MyTable.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                $arrInput | Invoke-SnsSqliteObjectInsert -DataBase "C:\temp.sqlite" -Table "MyTable" -ConflictClause Replace;
              </code>
              <para> </para>
              <para>
                 Converts The Pipelined InputObjects Collection To SQL Parameters And Insert The Data Into MyTable.
              </para>
              <para> </para>
              <para>
                 In Case An Input Object Conflicts With Existing Entry, The Old One Will Be Replaced With The Data From The Input
                 Object.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            </summary>
            <para type="link" uri="https://github.com/svesavov/SnsSqlitePsModule"> svesavov / SnsSqlitePsModule - </para>
            <para type="link" uri="https://www.powershellgallery.com/packages/SnsSqlitePsModule/"> PowerShell Gallery - </para>
            <para type="link" uri="https://www.linkedin.com/in/svetoslavsavov"> Svetoslav Savov on LinkedIn - </para>
            <para type="link" uri="https://github.com/RamblingCookieMonster/PSSQLite"> RamblingCookieMonster / PSSQLite - </para>
            <para type="link" uri="https://sqlite.org/index.html"> SQLite V3 - </para>
            <para type="link" uri="https://www.sqlite.org/datatype3.html"> SQLite V3 Data Types - </para>
            <para type="link" uri="https://www.sqlite.org/lang.html"> SQLite V3 Supported SQL Syntax - </para>
            <para type="link" uri="http://www.sqlite.org/pragma.html"> SQLite V3 Pragma Statements - </para>
            <para type="link" uri="https://www.sqlitetutorial.net/"> SQLite V3 Tutorials - </para>
            <para type="link" uri="https://github.com/pawelsalawa/sqlitestudio/releases"> SQLite Studio - </para>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert.DataBase">
            <summary>
            <para type="description">Specifies SQLite DataBase File To Connect To.</para>
            <para type="description">The DataBase Must Exists, The CmdLet Won't Create It.</para>
            <para type="description">Accepts Either File Name Or Full Absolute UNC Paths.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert.Connection">
            <summary>
            <para type="description">Specifies Existing SQLite Connection.</para>
            <para type="description">In Case The Connection Is Not Open Or Expired The CmdLet Opens It.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert.Table">
            <summary>
            <para type="description">Specifies A Table Where The Data Will Be Inserted.</para>
            <para type="description">The Table Must Exist Inside The Specified DataBase, The CmdLet Won't Create It.</para>
            <para type="description">Allowed Characters In The Table Name Are: From a To z, From A To Z And _</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert.InputObject">
            <summary>
            <para type="description">Specifies A Collection Of Input Objects To Be Inserted Into The DataBase Table.</para>
            <para type="description">Input Object Properties Must Be Struct Or String.</para>
            <para type="description">Input Object Properties Must Not Be Collections Or Other Classes.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert.ConflictClause">
            <summary>
            <para type="description">Specifies A Conflict Clause To Use In Case A Conflict Occurs During Insert.</para>
            <para type="description">See https://www.sqlite.org/lang_conflict.html for more details.</para>
            <para type="description">Accepted Values: "Rollback", "Abort", "Fail", "Ignore" And "Replace"</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteObjectInsert.QueryTimeout">
            <summary>
            <para type="description">Specifies The Number Of Seconds Before The Query Times Out.</para>
            </summary>
        </member>
        <member name="T:SnsSqlitePsModule.InvokeSnsSqliteQuery">
            <summary>
            <para type="synopsis">
                Connects To A Specified SQLite DataBase, Executes SQL Query / Queries Against The DataBase, Reverts The Output In
                A Collection Of Specified DataType And Closes The SQL Session.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                Connects To A Specified SQLite DataBase, Executes SQL Query / Queries Against The DataBase, Reverts The Output In
                A Collection Of Specified DataType And Closes The SQL Session.
            </para>
            <para type="description">
                The CmdLet Is Based On Warren Frame's (RamblingCookieMonster) And His Contributors Project Named "PSSQLite". More
                Details Can Be Found In The Links In The Link Section Below.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                Like The Original CmdLet The Input Is Validated At The Beginning Within The Parameter Definitions. For That
                Purpose Custom Validation Attributes Were Developed, Since "[ValidateScript({})]" Validation Attribute Is Not
                Supported In C#.
            </para>
            <para type="description">
                The CmdLet Is Capable To Connect To The Specified SQLite DataBase / DataSource By Itself. There Is No Requirement
                SQLiteConnection To Be Established In Advance. In The Begin Method The CmdLet Evaluate The Provided Input And In
                Case DataBase Is Provided, The CmdLet Verifies The DataBase File Existence And If Needed Creates The DataBase
                File. For Some Reason Automatic DataBase File Creation Does Not Work In C#. Whenever A New DataBase Is Created,
                The User Is Notified With A Warning Message.
            </para>
            <para type="description">
                The Connection Is Established Once In The Begin Method. All The Specified Queries Are Sent In The Process Method.
                Therefore All The Queries Are Sent Over A Single Already Created And Verified Connection.
            </para>
            <para type="description">
                The CmdLet Will Execute All The Specified SQL Queries Or Single Query With Multiple Parameters Using A SQL
                Transaction. Because The Transaction Have To Be Started Before The First Query And The Queries Can Be Provided Via
                The Pipeline, The CmdLet Will Evaluate Only The First Provided Query. This Might Lead To Unexpected Behavior
                Whenever The First Provided Query Allows Transactions Usage And The Consequent Once Do Not. Then The SQLite Will
                Throw Errors And The Whole Transaction Will Be Reverted Even Though The First Queries Are Successful. The CmdLet
                Will Auto Create A Transaction When:
            </para>
            <para type="description">
                -- The Specified SQL Connection Is Not ReadOnly.
            </para>
            <para type="description">
                -- ReadOnly Parameter Of The CmdLet Is Not Specified Or It Is Explicitly Specified FALSE.
            </para>
            <para type="description">
                -- The First SQL Query Contains Neither "VACUUM" Nor "PRAGMA" Nor "COMMIT". "VACUUM" And "PRAGMA" Cannot Be Used
                In Transactions. Attempting To Do So Will Throw SQLite Error. "COMMIT" Keyword Is Used In The SQL Language To
                Commit Previously Created Transaction. In That Case It Is Assumed That The User Manages The Transactions By
                Himself Within The SQL Query And New Transaction Is Not Auto Created.
            </para>
            <para type="description">
                -- The First Query Contains Either "INSERT" Or "UPDATE" Statements. If We Nod Modify The Data Within The DataBase
                We In Fact Do Not Need DataBase Locks And Transaction Will Provide No Benefits, Rather Downsides Because It
                Prevents Other Clients To Modify That Data At That Time.
            </para>
            <para type="description">
                Whenever The Specified DataBase Doesn't Exist And ReadOnly Parameter Value Is TRUE, The CmdLet Will Override The
                Users Input And The DataBase Will Be Created And Opened In Write Mode.
            </para>
            <para type="description">
                Whenever The SQL Query Which Needs To Be Run Against The DataBase Is Too Complex Can Be Used SQL Query Input File.
                The CmdLet Does Allow Usage Of SQL Query File With Standard ".SQL" Extension With Specifying Of SQL Parameters As
                HashTable, However It Does Not Support Usage Of Multiple ".SQL" Files At Once. It Still Can Be Used To Import
                Single SQL Query And Using Of Collection Of SQL Parameter Dictionaries To Insert Multiple Rows At Once. The ".SQL"
                File Read Happens In Begin Method, Which Exclude The Possibility To Execute Multiple SQL Queries At Once. I Don't
                Want File Operations In Process Method Because Of Performance Considerations.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                The CmdLet Have Four ParameterSets Which Represent The Allowed Combination Of Input Parameters.
            </para>
            <para type="description">
                The CmdLet Parameters And Pipeline Were Redesigned, Because For Me Makes More Sense To Use The Pipeline For
                Sending SQL Queries And SQL Parameters Rather Than Sending DataBase Sources. In My Automation Scripts I Mostly Use
                Multiple Queries And Parameters Run Against Single DataBase Rather Than Simultaneously Run The Same Query With The
                Same Parameters Against Multiple DataBases. If I Ever Need High Availability On My Automations Would Prefer To
                Schedule Them To Run On A Virtual Machine Which Is A Resource On ESX Or Other Virtualization Platform Which Allows
                The Virtual Machine To Be Replicated And Powered On Different Host Machines Rather Than Writing Of A Script
                Capable To Jump From One Machine To Another. With The New Parameters And Pipeline Design The CmdLet Can:
            </para>
            <para type="description">
                - Runs Single SQL Query Without Any SQL Parameters HashTable. Provided Directly To The Parameters Or As Object
                Property Of An Object Coming From The Pipeline. Using This Option Is Not Desirable Whenever Within The Query We
                Have Users Input Because Of SQL Injection Risk.
            </para>
            <para type="description">
                - Single SQL Query And Single SQL Parameters HashTable, Provided Directly To The Parameters Or Via The Pipeline.
                Here Are Possible Two Combinations: The Query And The Parameter As Properties Of An Object Coming From The
                Pipeline Or The SQL Parameters HashTable Coming From The Pipeline And Query Specified As A Parameter.
            </para>
            <para type="description">
                - Single SQL Query And Collection Of SQL Parameters HashTables. In This Case The Parameters Represents Multiple
                Rows Which Have To Be Inserted Within Single Table. The User Have To Keep In Mind That The SQL Query Must Have SQL
                Variables For Each Of The Columns And Each HashTable In The Collections Have To Have Keys Corresponding To Each Of
                The SQL Variables. The SQL Query And Its Corresponding HashTables Collection Can Be Specified Either Directly To
                The Parameters, Or Via As Properties Of An Object Coming From Pipeline Or Specifying The Query To The CmdLet Query
                Parameter And The HashTables Collection Coming From The Pipeline.
            </para>
            <para type="description">
                The CmdLet Is Still Capable To Work With Collection Of SQL Queries, However The Queries And Their Corresponding
                SQL Parameters HashTable / HashTables If Any, Can Be Provided Only Within Properties Of Objects Collection Coming
                From The Pipeline. Single Object Coming From The Pipeline Cannot Have Multiple SQL Queries.
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description">
                To Simplify The Dates Managing The Module Offers Predefined Formatting Strings To Convert DateTime Object To
                Understandable For SQLite Format. Although The CmdLet Will Process SQL Parameters Date Values Without Being
                Converted Upfront To Strings.
            </para>
            <para type="description">
                Leaving The DateTime Objects To Be Automatically Managed Might Lead To Unexpected Results Related With The
                DateTime Syntax Coming From The Regional Settings On The Machine, Daylight Saving Related And TimeZone Related
                Issues. From That Perspective I Would Recommend The Dates To Be Normalized To Long Integer And To Be Stored In
                Numeric Columns.
            </para>
            <para type="description">
                [System.DateTime]::Now.ToFileTime() - Gets The System DateTime And Converts It To Long Integer.
            </para>
            <para type="description">
                [System.DateTime]::FromFileTime(108666144000000000) - Converts The Long Integer To Local DateTime With Time Zone
                And Daylight Saving Taken Into Consideration.
            </para>
            <para type="description">
                [System.DateTime]::FromFileTimeUtc(108666144000000000) - Converts The Long Integer To Universal DateTime. (Guess
                What Is The Date From The Example).
            </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <para type="description"> </para>
            <list type="alertSet">
                <item>
                    <term> </term>
                    <description>
                        <para>AUTHOR: Svetoslav Nedyalkov Savov</para>
                        <para>THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK</para>
                        <para>OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.</para>
                        <para></para>
                        <para></para>
                        <para></para>
                    </description>
                </item>
            </list>
            <example>
              <code>
                Invoke-SnsSqliteQuery -DataBase "temp.sqlite" `
                    -Query "CREATE TABLE Events (ID INTEGER, ComputerID INTEGER, Event VARCHAR(20), Date DATETIME)";
              </code>
              <para> </para>
              <para>
                Creates A Table "Events" And "temp.sqlite" DataBase If It Does Not Exists.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                Invoke-SnsSqliteQuery -DataBase "temp.sqlite" `
                    -Query "INSERT INTO Events (ID, ComputerID, Event, Date) VALUES (@ID, @ComputerID, @Event, @Date);" `
                    -SqlParameters `
                    @{
                        "@ID" = 1;
                        "@ComputerID" = 5
                        "Event" = "Error";
                        "Date" = [System.DateTime]::Now);
                    };
              </code>
              <para> </para>
              <para>
                Runs Single Query With Single SQL Parameters HashTable Against "temp.sqlite" DataBase.
              </para>
              <para>
                In The SQL Parameters Keys Are Used Both Strings With And Without At (@) Character.
              </para>
              <para> </para>
              <para>
                The Keys Match Exactly The SQL Query Variables. Please Note That There Are SQL Variables For Each Of The Columns.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                Invoke-SnsSqliteQuery -DataBase "temp.sqlite" `
                    -Query "INSERT INTO Computers (ID, HostName) VALUES (@ID, @HostName);" `
                    -SqlParameters `
                    @(
                        @{"@ID" = 1; "HostName" = "Computer1.contoso.com"; };
                        @{"@ID" = 2; "HostName" = "Computer2.contoso.com"; };
                    );
              </code>
              <para> </para>
              <para>
                Runs Single Query With Multiple SQL Parameters HashTables Against "temp.sqlite" DataBase.
              </para>
              <para>
                In The SQL Parameters Keys Are Used Both Strings With And Without At (@) Character.
              </para>
              <para> </para>
              <para>
                The Keys Match Exactly The SQL Query Variables. Please Note That There Are SQL Variables For Each Of The Columns.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            </summary>
            <para type="link" uri="https://github.com/svesavov/SnsSqlitePsModule"> svesavov / SnsSqlitePsModule - </para>
            <para type="link" uri="https://www.powershellgallery.com/packages/SnsSqlitePsModule/"> PowerShell Gallery - </para>
            <para type="link" uri="https://www.linkedin.com/in/svetoslavsavov"> Svetoslav Savov on LinkedIn - </para>
            <para type="link" uri="https://github.com/RamblingCookieMonster/PSSQLite"> RamblingCookieMonster / PSSQLite - </para>
            <para type="link" uri="https://sqlite.org/index.html"> SQLite V3 - </para>
            <para type="link" uri="https://www.sqlite.org/datatype3.html"> SQLite V3 Data Types - </para>
            <para type="link" uri="https://www.sqlite.org/lang.html"> SQLite V3 Supported SQL Syntax - </para>
            <para type="link" uri="http://www.sqlite.org/pragma.html"> SQLite V3 Pragma Statements - </para>
            <para type="link" uri="https://www.sqlitetutorial.net/"> SQLite V3 Tutorials - </para>
            <para type="link" uri="https://github.com/pawelsalawa/sqlitestudio/releases"> SQLite Studio - </para>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.DataBase">
            <summary>
            <para type="description">Specifies SQLite DataBase File To Connect To.</para>
            <para type="description">In Case DataBase Doesn't Exist The CmdLet Creates It And Throw Warning.</para>
            <para type="description">Accepts Either File Name Or Full Absolute UNC Paths.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.ReadOnly">
            <summary>
            <para type="description">Specifies To Open The DataBase In ReadOnly Mode.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.Connection">
            <summary>
            <para type="description">Specifies Existing SQLite Connection.</para>
            <para type="description">In Case The Connection Is Not Open Or Expired The CmdLet Opens It.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.Query">
            <summary>
            <para type="description">Specifies The SQL Query To Be Run.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.InputFile">
            <summary>
            <para type="description">Specifies A ".SQL" File To Be Used As Query Input.</para>
            <para type="description">Works Only With Full Absolute UNC Path To The File.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.SqlParameters">
            <summary>
            <para type="description">HashTable Of Parameters For Parameterized SQL Queries.</para>
            <para type="description">The HashTable Keys Must Match The SQL Query Variable Names.</para>
            <para type="description">The Keys Might Be Specified Either With Or Without At (@) Character In Front.</para>
            <para type="description">The CmdLet Will Take Care To Add Them If Missing.</para>
            <para type="description">Example:</para>
            <para type="description">-Query "SELECT * FROM tblServers WHERE ServerFqdn LIKE @Server"</para>
            <para type="description">-SqlParameters @{"@Server" = "Server01.contoso.com"}</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.QueryTimeout">
            <summary>
            <para type="description">Specifies The Number Of Seconds Before The Query Times Out.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.As">
            <summary>
            <para type="description">Specifies To The CmdLet To Revert The Output In One Of The Following Types:</para>
            <para type="description">[System.Data.DataSet]</para>
            <para type="description">[System.Data.DataTable[]]</para>
            <para type="description">[System.Data.DataRow[]]</para>
            <para type="description">[System.Management.Automation.PSCustomObject[]]</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.InvokeSnsSqliteQuery.AppendDataSource">
            <summary>
            <para type="description">Specifies To Append The SQLite DataBase Path To The Output.</para>
            </summary>
        </member>
        <member name="T:SnsSqlitePsModule.NewSnsSqliteConnection">
            <summary>
            <para type="synopsis">
                Initializes And Reverts A SQLiteConnection Object.
            </para>
            <para type="description">
                Initializes And Reverts A SQLiteConnection Object.
            </para>
            <para type="description">
                If The Specified DataBase Doesn't Exist, The CmdLet Throw A Warning And Creates The DataBase. When This Happen And
                ReadOnly Mode Is Requested, The CmdLet Will Ignore Users Input And Will Establish The Connection To The Newly
                Created DataBase In Read Write Mode. If Read Only Connections To Multiple DataBases Are Needed And Only One Of
                Those DataBases Doesn't Exist, Only That Connection Will Be In Read Write Mode And The Remaining Will Be In Read
                Only Mode.
            </para>
            <para type="description">
                By Default The CmdLet Establish The Connection To The Specified DataBase With Opening Of A Session, However Using
                Open Parameter It Can Create The SQLiteConnection Object Without Opening Of Session.
            </para>
            <list type="alertSet">
                <item>
                    <term> </term>
                    <description>
                        <para>AUTHOR: Svetoslav Nedyalkov Savov</para>
                        <para>THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK</para>
                        <para>OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.</para>
                        <para></para>
                        <para></para>
                        <para></para>
                    </description>
                </item>
            </list>
            <example>
              <code>
                  [System.Data.SQLite.SQLiteConnection]$objConn = New-SnsSqliteConnection -DataBase "C:\TempDB\temp.sqlite" `
                  -Open:$false;
              </code>
              <para> </para>
              <para>
                Creates Connection To A DataBase Located In The Specified Folder Without Opening Of The Session.
              </para>
              <para>
                If The DataBase File Doesn't Exist In The Specified Folder, Creates The DataBase. Then Creates Connection To The
                DataBase Without Opening Of The Session.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                [System.Data.SQLite.SQLiteConnection]$objConn = New-SnsSqliteConnection -DataBase "temp.sqlite";
              </code>
              <para> </para>
              <para>
                Creates And Opens A Connection To A DataBase Located In The Working Folder.
              </para>
              <para>
                If The DataBase File Doesn't Exist In The Current Working Folder, Creates It. Then Creates And Opens A Connection
                To The DataBase.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            <example>
              <code>
                $objProdConn, $objBackupConn = New-SnsSqliteConnection -DataBase "temp.sqlite", "Backup.sqlite" -ReadOnly;
              </code>
              <para> </para>
              <para>
                Creates And Opens A Connection To "temp.sqlite" DataBase Located In The Working Folder In ReadOnly Mode. For The
                Purpose Of The Example It Needs To Be Existing DataBase File With Data Inside.
              </para>
              <para>
                For The Purpose Of The Example DataBase "Backup.sqlite" Is Not Existing DataBase. In That Case DataBase
                "Backup.sqlite" Is Created, And Because It Is New DataBase The Output Connection Object Is In "Modify" Mode.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
              <code>
                $objProdConn.BackupDatabase($objBackupConn, "main", "main", -1, $null, 0);
              </code>
              <para> </para>
              <para>
                Backups All The Data From Production DataBase To The Backup One. This Way With Two Lines Of Code We Can Create New
                DataBase And Copy/Backup All The Data From An Existing To The New DataBase.
              </para>
              <para> </para>
              <para> </para>
              <para> </para>
            </example>
            </summary>
            <para type="link" uri="https://github.com/svesavov/SnsSqlitePsModule"> svesavov / SnsSqlitePsModule - </para>
            <para type="link" uri="https://www.powershellgallery.com/packages/SnsSqlitePsModule/"> PowerShell Gallery - </para>
            <para type="link" uri="https://www.linkedin.com/in/svetoslavsavov"> Svetoslav Savov on LinkedIn - </para>
            <para type="link" uri="https://github.com/RamblingCookieMonster/PSSQLite"> RamblingCookieMonster / PSSQLite - </para>
            <para type="link" uri="https://sqlite.org/index.html"> SQLite V3 - </para>
            <para type="link" uri="https://www.sqlite.org/datatype3.html"> SQLite V3 Data Types - </para>
            <para type="link" uri="https://www.sqlite.org/lang.html"> SQLite V3 Supported SQL Syntax - </para>
            <para type="link" uri="http://www.sqlite.org/pragma.html"> SQLite V3 Pragma Statements - </para>
            <para type="link" uri="https://www.sqlitetutorial.net/"> SQLite V3 Tutorials - </para>
            <para type="link" uri="https://github.com/pawelsalawa/sqlitestudio/releases"> SQLite Studio - </para>
        </member>
        <member name="P:SnsSqlitePsModule.NewSnsSqliteConnection.DataBase">
            <summary>
            <para type="description">Specifies SQLite DataBase File To Connect To.</para>
            <para type="description">In Case DataBase Doesn't Exist The CmdLet Creates It And Generates Warning.</para>
            <para type="description">Accepts Either File Name Or Full Absolute UNC Paths.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.NewSnsSqliteConnection.ReadOnly">
            <summary>
            <para type="description">Specifies To Open The DataBase In ReadOnly Mode.</para>
            </summary>
        </member>
        <member name="P:SnsSqlitePsModule.NewSnsSqliteConnection.Open">
            <summary>
            <para type="description">Specifies To Open The SQL Connection.</para>
            <para type="description">Connection Is Opened By Default. Used To Create A Connection Without Opening It.</para>
            </summary>
        </member>
    </members>
</doc>