-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiboxdb-java-csharp-embedded-nosql-database.html
More file actions
754 lines (620 loc) · 26.3 KB
/
iboxdb-java-csharp-embedded-nosql-database.html
File metadata and controls
754 lines (620 loc) · 26.3 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="fast lightweight embedded ACID NoSQL document databases for .net core c# java android unity mono xamarin linux windows">
<link rel="shortcut icon" href="favicon.ico" />
<link rel="bookmark" href="favicon.ico" />
<title>iBoxDB Lightweight Embedded ACiD Java C# NoSQL Document Database Android Unity Xamarin Mono</title>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="highlight/styles/vs.css">
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer" style="border-bottom-style: solid; border-bottom-width: medium; border-bottom-color: #33CC00;">
<header class="inner">
<a href="index.html"><div id="logo"></div>
<h1 id="project_title">iBoxDB</h1></a>
<h2 id="project_tagline">Fast ACID Table-Style Document NoSQL Database</h2>
<div id="downloads">
<a href="#nosql_download">DOWNLOAD</a>
</div>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<br><br>
<p>
Best lightweight stable self-contained embeddable database. <br> Small fast multi-threaded engines have zero deployment cost.
</p>
<p>
Dual Core Application Database
<br />
For JAVA C# Android Unity Xamarin Mono Linux Windows.
</p>
<!-- key words -->
<div style="width: 1px; height: 1px; overflow: hidden">
Best lightweight stable standalone self contained NoSQL document database, java .net core android xamarin mono.
embedded database nosql storage engines, small fast multithreaded engine has zero deployment cost,
for real time and embedded applications.
lite NoSQL DB with SQL support and object relational mapping ORM, ACID transaction document database.
C# Java embeddable NoSQL database best Key-Value and Key-Only document database.
</div>
<h3 id="nosql_download">Download</h3>
<span class="dlversion">[FREE] iBoxDB.NET v3.9.2 iBoxDB.JAVA v3.9.2</span>
<br />
[<a href="https://sourceforge.net/settings/mirror_choices?projectname=application-database&filename=iboxdb392.zip&selected=pilotfiber" target="_blank">Download</a>]
[<a href="https://github.com/iboxdb/hijk/raw/dependencies/kits/iboxdb392.zip" target="_blank">Download Mirror</a>]
<br />
*All platforms.<br />
Composite-Index Improved, supports ( ==, <= , >= ) and ( <, > ). <br>
(X<=8),(X>=8) a bit faster than (X<9),(X>7).
<br />
<br />
<span class="dlversion">[FREE] iBoxDB.NET v4.0 iBoxDB.JAVA v4.0</span>
<br />
[<a href="https://sourceforge.net/settings/mirror_choices?projectname=application-database&filename=iboxdb411.zip&selected=pilotfiber" target="_blank">Download</a>]
[<a href="https://github.com/iboxdb/hijk/raw/dependencies/kits/iboxdb411.zip" target="_blank">Download Mirror</a>]
<br />
Encryption.<br />
<pre><code class="java">mask_key = (byte[])load_movie( "LePredateur.mp4" )</code></pre>
Python Compatible. <br /> Wasm Compatible.
<br />
<br />
<div>
<script src="highlight/compact_share_buttons.packS.jS?SRC=USER"></script>
</div>
<br />
<!--
<div id="smart-button-container" style="text-align: left" >
<div><label for="description">Name </label><input type="text" name="descriptionInput" id="description" maxlength="127" value=""></div>
<div><label for="amount">Contribution </label><input name="amountInput" type="number" id="amount" value="" ><span> $</span></div>
<div id="invoiceidDiv" style="display: none;"><label for="invoiceid"> </label><input name="invoiceid" maxlength="127" type="text" id="invoiceid" value="" ></div>
<div style="width:50%; margin-top: 0.625rem;" id="paypal-button-container"></div>
<p id="descriptionError" style="visibility: hidden; color:red; font-size:10px">Please enter a description</p>
<p id="priceLabelError" style="visibility: hidden; color:red; font-size:10px">Please enter a price</p>
<p id="invoiceidError" style="visibility: hidden; color:red; font-size:10px">Please enter an Invoice ID</p>
</div
-->
<h3>Find Somethings Useful for Yourself</h3>
<a href="https://github.com/iboxdb/ftserver" target="_blank">Full Text Search Engine Java</a>
<br />
<a href="https://github.com/iboxdb/ftserver-cs" target="_blank">Full Text Search Engine C#</a>
<br />
<a href="https://sourceforge.net/projects/ftserver-android/" target="_blank">Self Hosted Search Engine Android</a>
<br />
<h3>Code is great, show me the benchmark</h3>
<a href="https://sourceforge.net/p/teadb/code/" target="_blank">Benchmark With MySQL Java Maven</a>
<br />
<a href="https://github.com/iboxdb/leafdb" target="_blank">Benchmark With MongoDB Java Maven</a>
<br />
<a href="https://sourceforge.net/p/benchmarksql3/code/" target="_blank">Benchmark With SQLite C# .NET</a>
<br />
<br />
<!-- Examples -->
<h3>Examples</h3>
<a href="javascript:void(0)" onclick="javascript:code9.style.display='block'">The DB Life Cycle</a>
<br />
<pre style="display: none" id="code9"><code class="java">import iboxdb.localserver.*;
public class App{
public static AutoBox auto;
public static Box cube(){
return auto.cube();
}
}
synchronized static void onApplicationStart() {
DB.root(path);
DB db = new DB(1);
db.getConfig()
.ensureTable(Member.class, "Table", "Id")
.ensureIndex(Member.class, "Table", "Name");
//Tree->Parts
db.getConfig()
.ensureTable(Node.class, "Node", "Id")
.ensureIndex(Node.class, "Node", "Parent");
db.getConfig()
.ensureTable(Part.class, "Part", "Id")
.ensureIndex(Part.class, "Part", "Node");
DatabaseConfig cfg = db.getConfig();
cfg.CacheLength = cfg.mb(512L);
cfg.FileIncSize = (int)cfg.mb(4);
App.auto = db.open();
}
void anywhere1() {
App.auto.insert("Table", new Member());
}
void anywhere2() {
try (Box box = App.cube()) {
box.d("Table").insert(new Member());
CommitResult cr = box.commit();
}
}
boolean exists(Box box) {
return box.count("from Table limit 0,1") > 0;
}
<V> Iterable<V> startsWith(Box box, Class<V> vClass, String prefix) {
String begin = prefix;
char[] cs = prefix.toCharArray();
cs[cs.length - 1] = (char) ((short) cs[cs.length - 1] + 1);
String end = new String(cs);
return box.select(vClass,"from Table where Name>=? & Name<?",begin,end);
}
void treeJoin(Box box, long nodeRoot, int maxLevel, StringBuilder result) {
for (Node node :
box.select(Node.class, "from Node where Parent==?", nodeRoot)) {
result.append(" NODE:").append(node.Id);
for (Part part :
box.select(Part.class, "from Part where Node==?", node.Id)) {
result.append(" PART:").append(part.Id);
}
treeJoin(box, node.Id, maxLevel + 1, result);
}
}
synchronized static void onApplicationClose() {
//Wait for all background/async tasks to finished.
App.waitfor();
App.auto.getDatabase().close();
}
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code10.style.display='block'">Use DatabaseServer to Manage Configs</a>
<br />
<pre style="display: none" id="code10"><code class="cs">using IBoxDB.LocalServer;
using IBoxDB.LocalServer.IO;
public class AppServer : LocalDatabaseServer
{
private static AppServer server = new AppServer();
public static IDatabase DB(long address)
{
return server.GetInstance(address);
}
abstract class Config : BoxFileStreamConfig
{
public Config() : base()
{
CacheLength = MB(512); //1024L*1024L*512L
FileIncSize = (int)MB(4);
//Thread, default is 4
ReadStreamCount = 8;
//set equal to 1 in small device.
//ReadStreamCount = 1;
}
}
class MainConfig : Config
{
public MainConfig() : base()
{
EnsureTable<Member>("Member", "Id");
//set Max-Length = 20, String default is 32
EnsureIndex<Member>("Member", "Name(20)");
EnsureTable<Product>("Product", "Type", "UID");
}
}
class InventoryConfig : Config
{
public InventoryConfig() : base()
{
EnsureTable<Item>("Item", "Id");
}
}
protected override DatabaseConfig BuildDatabaseConfig(long address)
{
switch (address)
{
case 1L: return new MainConfig();
case 2L: return new InventoryConfig();
default: return null;
}
}
}
void Anywhere1()
{
var auto = AppServer.DB(1L).Get();
auto.Insert("Member", new Member());
}
void Anywhere2()
{
var db = AppServer.DB(2L);
using (var box = db.Cube())
{
box["Item"].Insert(new Item());
CommitResult cr = box.Commit();
}
}
void OnApplicationClose()
{
AppServer.server.Dispose();
}</code></pre>
<a href="javascript:void(0)" onclick="javascript:code13.style.display='block'">JSP Config</a>
<br />
<pre style="display: none" id="code13"><code class="jsp">//db.jsp
<%@page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<%@page import="iboxdb.localserver.*" %>
<%!
public static AutoBox auto() {
synchronized (DB.class) {
if (DB.Tag != null) {
return (AutoBox) DB.Tag;
}
String root = System.getProperty("user.home") + "/jsp_data/";
new java.io.File(root).mkdirs();
DB.root(root);
DB db = new DB(1);
db.getConfig().ensureTable(JSPUser.class, "JSPUser", "id");
DB.Tag = db.open();
return (AutoBox) DB.Tag;
}
}
public static class JSPUser {
public long id;
public String name;
}
%>
//index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8" session="false"%>
<%@include file="db.jsp" %>
<%
long id = auto().newId();
JSPUser user = new JSPUser();
user.id = id;
user.name = "iBoxDB on JSP -" + user.id;
auto().insert("JSPUser", user);
%>
<html>
<body>
<h1><%=auto().get(JSPUser.class, "JSPUser", id).name%> </h1>
</body>
</html></code></pre>
<a href="javascript:void(0)" onclick="javascript:code4.style.display='block'">Save DB as String</a>
<br />
<pre style="display: none" id="code4"><code class="cs">Start(){
byte[] data = Convert.FromBase64String(PlayerPrefs.GetString("DB",""));
db = new DB(data);
db.MinConfig().FileIncSize = 1;
...
auto = db.Open();
}
Save() {
byte[] data = db.GetBuffer();
//data = Zip(data); = 1/5
PlayerPrefs.SetString("DB",Convert.ToBase64String(data));
PlayerPrefs.Save();
}
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code3.style.display='block'">Unity3D WebGL Save</a>
<br />
<pre style="display: none" id="code3"><code class="cs">if (GUI.Button(new Rect(0, 50, Screen.width / 2, 50), "Save")) {
Application.ExternalEval("FS.syncfs(false, function (err) {});");
}
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code11.style.display='block'">Cache Only & Heat Up</a>
<br />
<pre style="display: none" id="code11"><code class="cs">DB db = new DB(DB.CacheOnlyArg);
//Using Thread to heat engine up Before Application.Start()
//System.Threading.Tasks.Task.Run((Action)Hot);
new Thread(() => { Hot(); }).Start();
static AutoBox auto;
public static void Hot() {
var db = new DB();
db.GetConfig().EnsureTable<Item>("Item", "Time", "Gid");
auto = db.Open();
auto.Insert("Item", new Item());
auto.Select("from Item");
}</code></pre>
<a href="javascript:void(0)" onclick="javascript:code12.style.display='block'">Complex Search, Region Control</a>
<br />
<pre style="display: none" id="code12"><code class="cs">//use a simple query to control search region
box.Select<User>("from User where Version>? limit 0,1000", last)
//with a complex query to filter data
.Where((u) => {
if ( u... )
if ( u... )
return u.Time > dt ;
});
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code21.style.display='block'">Changed Values</a>
<br />
<pre style="display: none" id="code21"><code class="cs">using IBoxDB.LocalServer.Replication;
DB db = new DB();
db.SetBoxRecycler(
(Socket socket, BoxData outBox, bool normalPoweroff) => {
if (socket.Actions > 0) {
foreach (var e in outBox.GetActions()) {
var actionType = e.ActionType;
var key = e.Key;
if (actionType == ActionType.Begin) {
continue;
}
var tableName = e.TableName;
var value = e.Select();
Log (actionType + " '" + tableName + "' at key '" + key
+ "' \r\n" + DB.ToString (value));
}}});
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code15.style.display='block'">Multiple Applications</a>
<br />
<pre style="display: none" id="code15"><code class="cs">static DB db = new DB(db_id);
//for LockFile Supported Platform only
db.WaitAnotherApp(1000 * 60 * 5);
using (var auto = db.Open()){
...
//auto.Cube(); Insert(), Update()...
}</code></pre>
<a href="javascript:void(0)" onclick="javascript:code16.style.display='block'">Forward CRUD</a>
<br />
<pre style="display: none" id="code16"><code class="java">try (Box box = auto.cube()) {
// forward Update()
Member m = box.d("Table", 100L).update(Member.class);
m.setName("Name");
m.setAmount(BigDecimal.TEN);
CommitResult cr = box.commit();
}</code></pre>
<a href="javascript:void(0)" onclick="javascript:code18.style.display='block'">Big Cache</a>
<br />
<pre style="display: none" id="code18"><code class="java"> DatabaseConfig cfg = db.getConfig();
cfg.CacheLength = cfg.mb(1024L*3L);
//or
cfg.CacheLength = 1024L*1024L*1024L*3L
//Overflow int
//1024*1024*1024*3
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code19.style.display='block'">Mobile Cache</a>
<br />
<pre style="display: none" id="code19"><code class="java"> DB.root(path);
DB db = new DB();
DatabaseConfig config = db.getConfig();
//mobiles have only 256MB memory, set Cache to 16 or 32MB.
config.CacheLength = config.mb(32);
config.FileIncSize = 1024 * 64;
config.SwapFileBuffer = 1024 * 64;
config.ReadStreamCount = 1;
config.WriteStreamCount = 1;
App.auto = db.open();
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code17.style.display='block'">Schemata</a>
<br />
<pre style="display: none" id="code17"><code class="java">auto.getDatabase().getSchemata()
</code></pre>
<!--
<a href="javascript:void(0)" onclick="javascript:code20.style.display='block'">Virtual memory</a>
<br />
<pre style="display: none" id="code20"><code class="sh">for 8G+ RAM Machine
use DatabaseConfig.CacheLength to Control Memory, turn off virtual memory.
Linux:
# free -h
# sudo swapoff -a
Windows:
System Properties(Win+Pause) - Advanced system settings - Advanced
- Performance Settings - Advanced - Virtual Memory Change -
uncheck Automatically manage paging file - select No paging file -
click Set - OK restart
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code23.style.display='block'">Creating Big Test Data</a>
<br />
<pre style="display: none" id="code23"><code class="java">//-Xmx6G
var db = new DB(100);
db.getConfig().ensureTable(new Ason("Id:", 0L), "Table");
//Disable [SwapFileBuffer] can insert very big object
//ONLY for creating test data.
db.getConfig().SwapFileBuffer = 0;
var auto = db.open();
try (Box box = auto.cube()) {
var ason = new Ason("Id:", 0L,
"Bytes:", new byte[Integer.MAX_VALUE / 3]);
ason.set("Id", 1L);
((byte[]) ason.get("Bytes"))[1] = 55;
box.d("Table").insert(ason);
ason.set("Id", 2L);
((byte[]) ason.get("Bytes"))[1] = 66;
box.d("Table").insert(ason);
ason.set("Id", 3L);
((byte[]) ason.get("Bytes"))[1] = 77;
box.d("Table").insert(ason);
CommitResult cr = box.commit();
System.out.println("Commit : " + cr);
}
auto.getDatabase().close();
db = new DB(100);
auto = db.open();
try (Box box = auto.cube()) {
var local = box.d("Table", 1L).select();
System.out.println(((byte[]) local.get("Bytes")).length);
System.out.println(((byte[]) local.get("Bytes"))[1]);
local = box.d("Table", 2L).select();
System.out.println(((byte[]) local.get("Bytes")).length);
System.out.println(((byte[]) local.get("Bytes"))[1]);
local = box.d("Table", 3L).select();
System.out.println(((byte[]) local.get("Bytes")).length);
System.out.println(((byte[]) local.get("Bytes"))[1]);
}</code></pre
-->
<a href="javascript:void(0)" onclick="javascript:code22.style.display='block'">Dataset Combiner</a>
<br />
<pre style="display: none" id="code22"><code class="cs">//combining dataset
public class Combiner<T>
{
public Combiner(Func<T, object> getid){}
}
class Item
{
public long Id;
public string Name;
public string Location;
}
static void Main(string[] args)
{
DB db = new DB();
db.GetConfig().EnsureTable<Item>("Item", "Id")
.EnsureIndex<Item>("Item", "Name")
.EnsureIndex<Item>("Item", "Location");
AutoBox auto = db.Open();
using(Box box = auto.Cube())
{
Combiner<Item> combiner = new Combiner<Item>(t => t.Id);
combiner.Add(box.Select<Item>("from Item where Name==?", "Name4"));
combiner.Add(box.Select<Item>("from Item where Id==?", 1L));
combiner.Add(box.Select<Item>("from Item where Id==?", 2L));
combiner.Add(
box.Select<Item>("from Item where Location==?", "Location6"));
}
}
</code></pre>
<a href="javascript:void(0)" onclick="javascript:code1.style.display='block'">Customize .NET Strong Name</a>
<br />
<pre style="display: none" id="code1"><code class="ss"> sn -k kp.snk
ildasm A.dll /out:A.il
rename A.dll A.bak
ilasm A.il /dll /key=kp.snk</code></pre>
<br />
<br />
<!-- Links -->
<h3>Links</h3>
<a href="https://github.com/iboxdb/jmegradle" target="_blank">Gradle Demo with jMonkeyEngine</a>
<br />
<a href="https://sourceforge.net/p/datastorexpo/code/" target="_blank">.NET Linq, integrating with XPO (SQL ORM)</a>
<br />
<a href="https://github.com/iboxdb/aspnet-cross-platform-db/tree/master/Godot" target="_blank">Godot NoSQL Wrapper</a>
<br />
<a href="https://github.com/iboxdb/forjava/wiki/Use-multi-thread-to-increase-speed-and-use-CommitEvent-to-decrease-conflict#ss-transaction" target="_blank">Snapshot and Serializable Isolations in one Transaction</a>
<br />
<a href="https://github.com/iboxdb/ason" target="_blank">Ason</a>
<br />
<a href="https://github.com/iboxdb/aspnet-cross-platform-db/blob/master/blazorwasm/IApp.cs" target="_blank">Blazor Wasm Client</a>
<br />
<a href="https://github.com/iboxdb/forjava/tree/master/demos" target="_blank">Key Only Example</a>
<br />
<a href="https://www.nuget.org/packages/iBoxDB/" target="_blank">Nuget Package</a>
<br />
<a href="https://sourceforge.net/p/sharpdevelop472/code/" target="_blank">WebApi UI and IDE</a>
<!--
<br />
<a href="https://github.com/iboxdb/teadb/" target="_blank">Maven Demo</a>
<br />
<a href="https://assetstore.unity.com/packages/tools/integration/iboxdb-150888" target="_blank">Unity Asset Store</a>
<br />
<a href="https://github.com/iboxdb/forjava/tree/master/java9" target="_blank">Java9 [module-info.java] Update</a
-->
<!-- Global Links -->
<div style="width: 1px; height: 1px; overflow: hidden">
<a href="cn.html" >CN DOC</a>
</div>
<br />
<br />
<h3>License</h3>
The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions.
<br /><br />
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer" style="border-top-style: solid; border-top-width: medium; border-top-color: #33CC00">
<footer class="inner">
<p class="copyright">
Dual Core Application Database
<br />
For JAVA C# Android Unity Xamarin Mono Linux Windows
<br />
NoSQL Storage Engines <a href="index.html" style="color: #FFFFFF; text-decoration: underline;">www.iBoxDB.com</a>
</p>
</footer>
</div>
<script src="highlight/highlight.packS.jS?SRC=USER"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!--
<script src="https://www.paypal.com/sdk/js?client-id=AYrgiVHQBkE6fchT2WVSLrPOFZbXMc_JE9d2fX-1Hb0s5VrzeTRems6L6ef81XCIGHUFt2dwYRKewPNI&enable-funding=venmo¤cy=USD" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
var description = document.querySelector('#smart-button-container #description');
var amount = document.querySelector('#smart-button-container #amount');
var descriptionError = document.querySelector('#smart-button-container #descriptionError');
var priceError = document.querySelector('#smart-button-container #priceLabelError');
var invoiceid = document.querySelector('#smart-button-container #invoiceid');
var invoiceidError = document.querySelector('#smart-button-container #invoiceidError');
var invoiceidDiv = document.querySelector('#smart-button-container #invoiceidDiv');
var elArr = [description, amount];
if (invoiceidDiv.firstChild.innerHTML.length > 1) {
invoiceidDiv.style.display = "block";
}
var purchase_units = [];
purchase_units[0] = {};
purchase_units[0].amount = {};
function validate(event) {
return event.value.length > 0;
}
paypal.Buttons({
style: {
color: 'blue',
shape: 'rect',
label: 'paypal',
layout: 'vertical',
},
onInit: function (data, actions) {
actions.disable();
if(invoiceidDiv.style.display === "block") {
elArr.push(invoiceid);
}
elArr.forEach(function (item) {
item.addEventListener('keyup', function (event) {
var result = elArr.every(validate);
if (result) {
actions.enable();
} else {
actions.disable();
}
});
});
},
onClick: function () {
if (description.value.length < 1) {
descriptionError.style.visibility = "visible";
} else {
descriptionError.style.visibility = "hidden";
}
if (amount.value.length < 1) {
priceError.style.visibility = "visible";
} else {
priceError.style.visibility = "hidden";
}
if (invoiceid.value.length < 1 && invoiceidDiv.style.display === "block") {
invoiceidError.style.visibility = "visible";
} else {
invoiceidError.style.visibility = "hidden";
}
purchase_units[0].description = description.value;
purchase_units[0].amount.value = amount.value;
if(invoiceid.value !== '') {
purchase_units[0].invoice_id = invoiceid.value;
}
},
createOrder: function (data, actions) {
return actions.order.create({
purchase_units: purchase_units,
});
},
onApprove: function (data, actions) {
return actions.order.capture().then(function (orderData) {
// Full available details
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
// Show a success message within this page, e.g.
const element = document.getElementById('paypal-button-container');
element.innerHTML = '';
element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: actions.redirect('thank_you.html');
});
},
onError: function (err) {
console.log(err);
}
}).render('#paypal-button-container');
}
try{
initPayPalButton();
}
catch(pp){
}
</script>
-->
</body>
</html>