orange-orm 4.5.2 → 4.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/changelog.md +5 -1
- package/index.html +100 -0
- package/package.json +1 -1
- package/src/client/index.mjs +2 -2
- package/src/map.d.ts +1 -1
- package/src/table/relation/newJoinLeg.js +1 -1
- package/src/table/relation/newManyLeg.js +1 -1
package/docs/changelog.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
## Changelog
|
|
2
|
+
__4.5.4__
|
|
3
|
+
Bugfix: hasMany relation through references relation gives empty array . See [#122](https://github.com/alfateam/orange-orm/issues/122)
|
|
4
|
+
__4.5.3__
|
|
5
|
+
Minor improvements of types in aggregate functions.
|
|
2
6
|
__4.5.2__
|
|
3
|
-
Bugfix: Aggregate functions are not allowed on root tables . See [#
|
|
7
|
+
Bugfix: Aggregate functions are not allowed on root tables . See [#121](https://github.com/alfateam/orange-orm/issues/121)
|
|
4
8
|
__4.5.1__
|
|
5
9
|
Bugfix: "Changed by Other User" Error Triggered by Precision Mismatch in Numeric Column. See [#120](https://github.com/alfateam/orange-orm/issues/120)
|
|
6
10
|
__4.5.0__
|
package/index.html
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
6
|
+
<title>Orange ORM</title>
|
|
7
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
8
|
+
</head>
|
|
9
|
+
<body class="bg-orange-50 text-gray-800 font-sans">
|
|
10
|
+
|
|
11
|
+
<!-- Logo on Neutral Background -->
|
|
12
|
+
<div class="bg-white shadow-md py-4">
|
|
13
|
+
<div class="max-w-6xl mx-auto px-4 flex items-center justify-center">
|
|
14
|
+
<img src="file:///C:/Users/lars.roald/repos/rdb/docs/orange.svg" alt="Orange ORM Logo" class="w-14 h-14" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<!-- Hero -->
|
|
19
|
+
<header class="bg-orange-500 text-white py-16 text-center">
|
|
20
|
+
<div class="max-w-4xl mx-auto px-4">
|
|
21
|
+
<h1 class="text-5xl font-bold">Orange ORM</h1>
|
|
22
|
+
<p class="mt-3 text-lg">Elegant, minimal, and expressive ORM for JavaScript and TypeScript.</p>
|
|
23
|
+
<div class="mt-6 space-x-4">
|
|
24
|
+
<a href="https://github.com/alfateam/orange-orm" target="_blank"
|
|
25
|
+
class="inline-block bg-white text-orange-600 font-semibold px-5 py-2 rounded shadow hover:bg-orange-100 transition">
|
|
26
|
+
View on GitHub
|
|
27
|
+
</a>
|
|
28
|
+
<a href="#examples"
|
|
29
|
+
class="inline-block bg-orange-600 text-white font-semibold px-5 py-2 rounded border border-white hover:bg-orange-700 transition">
|
|
30
|
+
See Examples
|
|
31
|
+
</a>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</header>
|
|
35
|
+
|
|
36
|
+
<!-- Main -->
|
|
37
|
+
<main class="max-w-4xl mx-auto px-4 py-16">
|
|
38
|
+
<section class="mb-16">
|
|
39
|
+
<h2 class="text-3xl font-bold text-orange-600 mb-4">Why Orange ORM?</h2>
|
|
40
|
+
<ul class="list-disc list-inside space-y-2 text-lg">
|
|
41
|
+
<li>Simple and expressive API</li>
|
|
42
|
+
<li>Type-safe and lightweight</li>
|
|
43
|
+
<li>Works out of the box with popular SQL databases</li>
|
|
44
|
+
<li>Built with modern JavaScript and TypeScript support</li>
|
|
45
|
+
</ul>
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<section id="examples" class="mb-16">
|
|
49
|
+
<h2 class="text-3xl font-bold text-orange-600 mb-6">Quick Examples</h2>
|
|
50
|
+
|
|
51
|
+
<div class="space-y-8">
|
|
52
|
+
<div>
|
|
53
|
+
<h3 class="text-xl font-semibold mb-2">Define a Model</h3>
|
|
54
|
+
<pre class="bg-gray-100 p-4 rounded text-sm overflow-auto"><code>import { defineModel } from 'orange-orm';
|
|
55
|
+
|
|
56
|
+
const User = defineModel('users', {
|
|
57
|
+
id: 'number',
|
|
58
|
+
name: 'string',
|
|
59
|
+
email: 'string'
|
|
60
|
+
});</code></pre>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div>
|
|
64
|
+
<h3 class="text-xl font-semibold mb-2">Create a Record</h3>
|
|
65
|
+
<pre class="bg-gray-100 p-4 rounded text-sm overflow-auto"><code>await User.create({
|
|
66
|
+
name: 'Alice',
|
|
67
|
+
email: 'alice@example.com'
|
|
68
|
+
});</code></pre>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div>
|
|
72
|
+
<h3 class="text-xl font-semibold mb-2">Find Records</h3>
|
|
73
|
+
<pre class="bg-gray-100 p-4 rounded text-sm overflow-auto"><code>const users = await User.find({ where: { name: 'Alice' } });</code></pre>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div>
|
|
77
|
+
<h3 class="text-xl font-semibold mb-2">Update</h3>
|
|
78
|
+
<pre class="bg-gray-100 p-4 rounded text-sm overflow-auto"><code>await User.update({ email: 'new@example.com' }, { where: { id: 1 } });</code></pre>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div>
|
|
82
|
+
<h3 class="text-xl font-semibold mb-2">Delete</h3>
|
|
83
|
+
<pre class="bg-gray-100 p-4 rounded text-sm overflow-auto"><code>await User.delete({ where: { id: 1 } });</code></pre>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</section>
|
|
87
|
+
|
|
88
|
+
<section class="mb-16">
|
|
89
|
+
<h2 class="text-3xl font-bold text-orange-600 mb-4">Get Started</h2>
|
|
90
|
+
<pre class="bg-gray-100 p-4 rounded text-sm mb-4"><code>npm install orange-orm</code></pre>
|
|
91
|
+
<p class="text-lg">Check the <a href="https://github.com/alfateam/orange-orm" class="text-orange-600 font-semibold underline" target="_blank">GitHub repo</a> for full documentation and examples.</p>
|
|
92
|
+
</section>
|
|
93
|
+
</main>
|
|
94
|
+
|
|
95
|
+
<footer class="text-center text-sm text-gray-500 py-8 border-t">
|
|
96
|
+
Built with love by <a href="https://github.com/alfateam" class="underline hover:text-orange-600" target="_blank">alfateam</a> · MIT License
|
|
97
|
+
</footer>
|
|
98
|
+
|
|
99
|
+
</body>
|
|
100
|
+
</html>
|
package/package.json
CHANGED
package/src/client/index.mjs
CHANGED
|
@@ -5676,7 +5676,7 @@ function requireNewJoinLeg () {
|
|
|
5676
5676
|
c.expand = relation.expand;
|
|
5677
5677
|
|
|
5678
5678
|
c.accept = function(visitor) {
|
|
5679
|
-
visitor.visitJoin(c);
|
|
5679
|
+
return visitor.visitJoin(c);
|
|
5680
5680
|
};
|
|
5681
5681
|
|
|
5682
5682
|
return c;
|
|
@@ -9853,7 +9853,7 @@ function requireNewManyLeg () {
|
|
|
9853
9853
|
var c = newOneLeg(relation);
|
|
9854
9854
|
c.name = relation.joinRelation.rightAlias;
|
|
9855
9855
|
c.accept = function(visitor) {
|
|
9856
|
-
visitor.visitMany(c);
|
|
9856
|
+
return visitor.visitMany(c);
|
|
9857
9857
|
};
|
|
9858
9858
|
|
|
9859
9859
|
c.expand = relation.expand;
|
package/src/map.d.ts
CHANGED
|
@@ -1085,7 +1085,7 @@ type ExtractColumnBools<T, TStrategy> = RemoveNever<{
|
|
|
1085
1085
|
type NegotiateNotNull<T> = T extends NotNull ? NotNull : {};
|
|
1086
1086
|
|
|
1087
1087
|
type FetchedProperties<T, TStrategy> = FetchedColumnProperties<T, TStrategy> & FetchedRelationProperties<T, TStrategy> & ExtractAggregates<TStrategy>
|
|
1088
|
-
type FetchedAggregateProperties<T, TStrategy> =
|
|
1088
|
+
type FetchedAggregateProperties<T, TStrategy> = ExtractAggregates<TStrategy>;
|
|
1089
1089
|
|
|
1090
1090
|
|
|
1091
1091
|
type FetchedRelationProperties<T, TStrategy> = RemoveNeverFlat<{
|