• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

typeorm / typeorm / 15219332477

23 May 2025 09:13PM UTC coverage: 17.216% (-59.1%) from 76.346%
15219332477

Pull #11332

github

naorpeled
cr comments - move if block
Pull Request #11332: feat: add new undefined and null behavior flags

1603 of 12759 branches covered (12.56%)

Branch coverage included in aggregate %.

0 of 31 new or added lines in 3 files covered. (0.0%)

14132 existing lines in 166 files now uncovered.

4731 of 24033 relevant lines covered (19.69%)

60.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.0
/src/entity-manager/SqljsEntityManager.ts
1
import { DataSource } from "../data-source/DataSource"
2
import { QueryRunner } from "../query-runner/QueryRunner"
3
import { EntityManager } from "./EntityManager"
1✔
4
import { SqljsDriver } from "../driver/sqljs/SqljsDriver"
5

6
/**
7
 * A special EntityManager that includes import/export and load/save function
8
 * that are unique to Sql.js.
9
 */
10
export class SqljsEntityManager extends EntityManager {
1✔
UNCOV
11
    readonly "@instanceof" = Symbol.for("SqljsEntityManager")
×
12

13
    private driver: SqljsDriver
14

15
    // -------------------------------------------------------------------------
16
    // Constructor
17
    // -------------------------------------------------------------------------
18

19
    constructor(connection: DataSource, queryRunner?: QueryRunner) {
UNCOV
20
        super(connection, queryRunner)
×
UNCOV
21
        this.driver = connection.driver as SqljsDriver
×
22
    }
23

24
    // -------------------------------------------------------------------------
25
    // Public Methods
26
    // -------------------------------------------------------------------------
27

28
    /**
29
     * Loads either the definition from a file (Node.js) or localstorage (browser)
30
     * or uses the given definition to open a new database.
31
     */
32
    async loadDatabase(
33
        fileNameOrLocalStorageOrData: string | Uint8Array,
34
    ): Promise<void> {
UNCOV
35
        await this.driver.load(fileNameOrLocalStorageOrData)
×
36
    }
37

38
    /**
39
     * Saves the current database to a file (Node.js) or localstorage (browser)
40
     * if fileNameOrLocalStorage is not set options.location is used.
41
     */
42
    async saveDatabase(fileNameOrLocalStorage?: string): Promise<void> {
UNCOV
43
        await this.driver.save(fileNameOrLocalStorage)
×
44
    }
45

46
    /**
47
     * Returns the current database definition.
48
     */
49
    exportDatabase(): Uint8Array {
UNCOV
50
        return this.driver.export()
×
51
    }
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc