Skip to content

Commit

Permalink
v0.5.7 4ecb99a
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 2, 2024
1 parent 0262d6e commit 46283a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ <h2 id="quick-start"><a aria-hidden="true" tabindex="-1" href="#quick-start" cla
<h3 id="-create-entity"><a aria-hidden="true" tabindex="-1" href="#-create-entity" class="anchor"><span class="icon icon-link"></span></a>❶ Create Entity</h3>
<p>Entity is a class that maps to a database table (or collection when using <code>Postgres</code>). You can create an entity by defining a new class and mark it with <strong><code>@Entity()</code></strong>:</p>
<p><code>./src/user.entity.ts</code></p>
<pre class="language-typescript"><code class="language-typescript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> DeleteDateColumn<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typenexus'</span><span class="token punctuation">;</span>
<pre class="language-typescript"><code class="language-typescript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typenexus'</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="2"><span class="token comment">// OR: </span>
</span><span class="code-line line-number" line="3"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> DeleteDateColumn<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typeorm'</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="3"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typeorm'</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="4">
</span><span class="code-line line-number" line="5"><span class="token decorator"><span class="token at operator">@</span><span class="token function">Entity</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</span><span class="code-line line-number" line="6"><span class="token keyword">export</span> <span class="token keyword">class</span> <span class="token class-name">User</span> <span class="token punctuation">{</span>
Expand All @@ -104,9 +104,9 @@ <h3 id="-create-entity"><a aria-hidden="true" tabindex="-1" href="#-create-entit
</span><span class="code-line line-number" line="16"> <span class="token decorator"><span class="token at operator">@</span><span class="token function">CreateDateColumn</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</span><span class="code-line line-number" line="17"> createAt<span class="token operator">:</span> Date<span class="token punctuation">;</span>
</span><span class="code-line line-number" line="18"><span class="token punctuation">}</span>
</span></code><input type="hidden" value="import { Entity, PrimaryGeneratedColumn, Column, DeleteDateColumn, CreateDateColumn } from &#x27;typenexus&#x27;;
</span></code><input type="hidden" value="import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from &#x27;typenexus&#x27;;
// OR:
import { Entity, PrimaryGeneratedColumn, Column, DeleteDateColumn, CreateDateColumn } from &#x27;typeorm&#x27;;
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from &#x27;typeorm&#x27;;
@Entity()
export class User {
Expand Down
8 changes: 4 additions & 4 deletions index.zh.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ <h2 id="快速开始"><a aria-hidden="true" tabindex="-1" href="#快速开始" c
<h3 id="-创建实体"><a aria-hidden="true" tabindex="-1" href="#-创建实体" class="anchor"><span class="icon icon-link"></span></a>❶ 创建实体</h3>
<p>实体是一个映射到数据库表(或在使用 <code>Postgres</code> 时映射到集合)的类。您可以通过定义一个新的类并用 <strong><code>@Entity()</code></strong> 标记来创建实体:</p>
<p><code>./src/user.entity.ts</code></p>
<pre class="language-typescript"><code class="language-typescript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> DeleteDateColumn<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typenexus'</span><span class="token punctuation">;</span>
<pre class="language-typescript"><code class="language-typescript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typenexus'</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="2"><span class="token comment">// 或者:</span>
</span><span class="code-line line-number" line="3"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> DeleteDateColumn<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typeorm'</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="3"><span class="token keyword">import</span> <span class="token punctuation">{</span> Entity<span class="token punctuation">,</span> PrimaryGeneratedColumn<span class="token punctuation">,</span> Column<span class="token punctuation">,</span> CreateDateColumn <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'typeorm'</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="4">
</span><span class="code-line line-number" line="5"><span class="token decorator"><span class="token at operator">@</span><span class="token function">Entity</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</span><span class="code-line line-number" line="6"><span class="token keyword">export</span> <span class="token keyword">class</span> <span class="token class-name">User</span> <span class="token punctuation">{</span>
Expand All @@ -104,9 +104,9 @@ <h3 id="-创建实体"><a aria-hidden="true" tabindex="-1" href="#-创建实体"
</span><span class="code-line line-number" line="16"> <span class="token decorator"><span class="token at operator">@</span><span class="token function">CreateDateColumn</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</span><span class="code-line line-number" line="17"> createAt<span class="token operator">:</span> Date<span class="token punctuation">;</span>
</span><span class="code-line line-number" line="18"><span class="token punctuation">}</span>
</span></code><input type="hidden" value="import { Entity, PrimaryGeneratedColumn, Column, DeleteDateColumn, CreateDateColumn } from &#x27;typenexus&#x27;;
</span></code><input type="hidden" value="import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from &#x27;typenexus&#x27;;
// 或者:
import { Entity, PrimaryGeneratedColumn, Column, DeleteDateColumn, CreateDateColumn } from &#x27;typeorm&#x27;;
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from &#x27;typeorm&#x27;;
@Entity()
export class User {
Expand Down

0 comments on commit 46283a1

Please sign in to comment.