fdb2 1.0.21 → 1.0.23

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/README.md CHANGED
@@ -1,4 +1,10 @@
1
- # fdb2 - 数据库管理工具
1
+ # fdb2 - 数据库管理工具 / Database Management Tool
2
+
3
+ **[中文](#中文)** | **[English](#english)**
4
+
5
+ ---
6
+
7
+ ## 中文
2
8
 
3
9
  一款轻量级、跨平台的数据库管理工具,支持多种数据库类型,提供类似 Navicat Premium 的使用体验。
4
10
 
@@ -317,3 +323,343 @@ rm -rf ~/.db-tool
317
323
  ---
318
324
 
319
325
  **享受使用 fdb2 数据库管理工具!如有任何问题,欢迎反馈。**
326
+
327
+ ---
328
+
329
+ ## English
330
+
331
+ A lightweight, cross-platform database management tool that supports multiple database types, providing a Navicat Premium-like experience.
332
+
333
+ ![fdb2 Preview](public/fdb2.png)
334
+
335
+ ### Quick Start
336
+
337
+ This is an open-source database management tool. You can install it globally via npm as a command-line tool, or download our pre-built desktop client application.
338
+
339
+ #### Desktop Client Download (Recommended)
340
+ If you prefer not to use the command line, you can directly download our pre-built cross-platform desktop client:
341
+ - **Windows / macOS / Linux**: [Go to Release page to download](https://github.com/fefeding/fdb2/releases/tag/client)
342
+ - Unzip and double-click to run, no environment configuration required.
343
+
344
+ #### Command Line Installation
345
+
346
+ ```bash
347
+ # Global installation
348
+ npm install -g fdb2
349
+
350
+ # Or use yarn
351
+ yarn global add fdb2
352
+
353
+ # Or use pnpm
354
+ pnpm add -g fdb2
355
+ ```
356
+
357
+ #### Start Service
358
+
359
+ ```bash
360
+ # Start the database management tool
361
+ fdb2 start
362
+
363
+ # Stop service
364
+ fdb2 stop
365
+
366
+ # Check service status
367
+ fdb2 status
368
+
369
+ # Restart service
370
+ fdb2 restart
371
+ ```
372
+
373
+ #### Access Application
374
+
375
+ After starting the service, open in browser (check the output for the actual URL, the port may vary):
376
+ ```
377
+ http://localhost:9800
378
+ ```
379
+
380
+ **Homepage**: [https://surl.fit/tools/tools/fdb2](https://surl.fit/tools/tools/fdb2)
381
+
382
+ ### Features
383
+
384
+ #### Connection Management
385
+ - Supports 8 database types: MySQL, PostgreSQL, SQLite, SQL Server, Oracle, CockroachDB, MongoDB, SAP HANA
386
+ - Visual connection configuration interface, simple and intuitive
387
+ - One-click test connection for quick verification
388
+ - Secure local storage of connection information
389
+
390
+ #### Database Structure
391
+ - Clear database information overview
392
+ - Detailed table structure viewing
393
+ - Complete column info, indexes, and foreign key relationships
394
+ - Real-time database size and statistics
395
+
396
+ #### Data Operations
397
+ - Quick table data viewing and pagination
398
+ - Flexible conditional queries and sorting
399
+ - Convenient data insert, edit, and delete
400
+ - Export data to JSON and CSV formats
401
+
402
+ #### SQL Query
403
+ - Code editor-style SQL input
404
+ - SQL syntax formatting for better readability
405
+ - Auto-save query history
406
+ - Batch query result display
407
+
408
+ #### Key Advantages
409
+ - **Zero Configuration**: Ready to use after global installation
410
+ - **Cross-Platform**: Full compatibility with Windows, macOS, and Linux
411
+ - **Lightweight & Efficient**: Low resource usage
412
+ - **Local Storage**: Data saved locally, safe and reliable
413
+ - **Offline Use**: Manage local databases without internet
414
+
415
+ ### Usage Guide
416
+
417
+ #### Add Database Connection
418
+
419
+ 1. Open browser and visit `http://localhost:9800`
420
+ 2. Click "Connection Management" in the left navigation
421
+ 3. Click "New Connection" button
422
+ 4. Fill in connection information:
423
+ - **Connection Name**: Custom name for easy identification (e.g., Production MySQL)
424
+ - **Database Type**: Select the corresponding database type
425
+ - **Host**: Database server address (use `localhost` or `127.0.0.1` for local databases)
426
+ - **Port**: Database service port (default port will be auto-filled)
427
+ - **Database Name**: The database name to connect to
428
+ - **Username/Password**: Database authentication credentials
429
+ 5. Click "Test Connection" to verify the configuration
430
+ 6. Save the connection configuration
431
+
432
+ #### View Database Structure
433
+
434
+ 1. Select "Database Structure" in the left navigation
435
+ 2. Select a configured database connection
436
+ 3. Select the database to view
437
+ 4. Browse table list and details:
438
+ - **Table Info**: Row count, size, and other statistics
439
+ - **Column Definitions**: Data types, constraints, default values, etc.
440
+ - **Index Info**: Primary keys, unique indexes, regular indexes
441
+ - **Foreign Keys**: Relationships between tables
442
+
443
+ #### View and Edit Table Data
444
+
445
+ 1. Click the "Data" button in the table list
446
+ 2. Set query conditions:
447
+ - **WHERE Condition**: Enter filter conditions (e.g., `id > 100`)
448
+ - **Order By**: Specify sorting (e.g., `create_time DESC`)
449
+ - **Page Size**: Adjust pagination (10/50/100/500)
450
+ 3. Click "Query" button to execute
451
+ 4. Supported operations:
452
+ - **View Details**: Click a row to view complete data
453
+ - **Edit Record**: Modify data and save
454
+ - **Delete Record**: Remove unwanted data
455
+ - **Insert Data**: Click "New" button to add data
456
+ - **Export Data**: Choose JSON or CSV format for export
457
+
458
+ #### Execute SQL Queries
459
+
460
+ 1. Click "SQL Query" in the left navigation
461
+ 2. Select a database connection
462
+ 3. Enter SQL statements in the editor
463
+ 4. Quick actions:
464
+ - **Ctrl + Enter** (Windows) or **Cmd + Enter** (Mac): Quick execute
465
+ - Click "Format" button: Beautify SQL statements
466
+ - View history: Click history button to select previous queries
467
+ 5. View query results with export support
468
+
469
+ #### Common SQL Examples
470
+
471
+ ```sql
472
+ -- Query first 10 rows
473
+ SELECT * FROM table_name LIMIT 10;
474
+
475
+ -- Conditional query
476
+ SELECT * FROM users WHERE status = 'active' ORDER BY created_at DESC;
477
+
478
+ -- Aggregate data
479
+ SELECT COUNT(*) as total, status FROM users GROUP BY status;
480
+
481
+ -- Insert data
482
+ INSERT INTO users (name, email, status) VALUES ('John', 'john@example.com', 'active');
483
+
484
+ -- Update data
485
+ UPDATE users SET status = 'inactive' WHERE last_login < '2024-01-01';
486
+
487
+ -- Delete data
488
+ DELETE FROM logs WHERE created_at < '2024-01-01';
489
+ ```
490
+
491
+ ### Supported Database Types
492
+
493
+ | Database Type | Default Port | Features |
494
+ |--------------|-------------|----------|
495
+ | MySQL | 3306 | Stored procedures, triggers, views, full-text search |
496
+ | PostgreSQL | 5432 | Stored procedures, triggers, views, JSON type |
497
+ | SQLite | - | Lightweight, file-based, no server required |
498
+ | SQL Server | 1433 | Microsoft database, stored procedures, triggers, views |
499
+ | Oracle | 1521 | Enterprise-grade, feature-rich |
500
+ | CockroachDB | 26257 | Distributed SQL, PostgreSQL compatible |
501
+ | MongoDB | 27017 | NoSQL document database |
502
+ | SAP HANA | 39013 | In-memory database, high-performance analytics |
503
+
504
+ **Compatibility Notes**:
505
+ - MariaDB, TiDB are compatible with MySQL — select MySQL type
506
+ - Aurora MySQL is compatible with MySQL — select MySQL type
507
+ - Aurora PostgreSQL is compatible with PostgreSQL — select PostgreSQL type
508
+ - Better-SQLite3 is compatible with SQLite — select SQLite type
509
+
510
+ ### FAQ
511
+
512
+ <details>
513
+ <summary>Installation & Startup</summary>
514
+
515
+ **Q: Service won't start after installation?**
516
+
517
+ A: Please check the following:
518
+ 1. Confirm correct installation: `npm install -g fdb2`
519
+ 2. Check Node.js version (v14+ recommended): `node --version`
520
+ 3. View error details: `fdb2 start --verbose`
521
+ 4. Check if the port is already in use
522
+
523
+ **Q: How to change the port?**
524
+
525
+ A: Use the `-p` parameter:
526
+ ```bash
527
+ fdb2 start -p 8080
528
+ ```
529
+
530
+ Or set via environment variable:
531
+ ```bash
532
+ # Windows
533
+ set PORT=8080
534
+ fdb2 start
535
+
536
+ # Mac/Linux
537
+ PORT=8080 fdb2 start
538
+ ```
539
+
540
+ </details>
541
+
542
+ <details>
543
+ <summary>Connection Issues</summary>
544
+
545
+ **Q: Failed to connect to database?**
546
+
547
+ A: Follow these troubleshooting steps:
548
+ 1. Confirm the database service is running
549
+ 2. Check network connection and port settings
550
+ 3. Verify username and password
551
+ 4. Check if the database allows remote connections
552
+ 5. Review database firewall settings
553
+
554
+ **Q: SQLite connection failed?**
555
+
556
+ A: SQLite requires a database file path:
557
+ - Absolute path: `D:\data\mydb.sqlite`
558
+ - Relative path: `./data/mydb.sqlite` (relative to data directory)
559
+ - Ensure the file exists and is readable
560
+
561
+ </details>
562
+
563
+ <details>
564
+ <summary>Data Operations</summary>
565
+
566
+ **Q: Empty query results?**
567
+
568
+ A: Possible reasons:
569
+ 1. The table has no data
570
+ 2. WHERE condition is too strict
571
+ 3. Wrong database or table name
572
+ 4. Insufficient query permissions
573
+
574
+ **Q: Cannot edit or delete data?**
575
+
576
+ A: Please check:
577
+ 1. Sufficient database permissions
578
+ 2. Foreign key constraints on the table
579
+ 3. Data is locked
580
+ 4. Check database error logs
581
+
582
+ </details>
583
+
584
+ <details>
585
+ <summary>Performance</summary>
586
+
587
+ **Q: Slow query speed?**
588
+
589
+ A: Optimization suggestions:
590
+ 1. Add appropriate indexes
591
+ 2. Limit query results (use LIMIT)
592
+ 3. Avoid `SELECT *`, only query needed fields
593
+ 4. Optimize WHERE conditions
594
+ 5. Consider batch processing for large datasets
595
+
596
+ **Q: Slow database info loading?**
597
+
598
+ A: Possible reasons:
599
+ 1. Too many tables in the database
600
+ 2. Large table data size
601
+ 3. Network latency
602
+ 4. Database performance issues
603
+
604
+ </details>
605
+
606
+ <details>
607
+ <summary>Data Security</summary>
608
+
609
+ **Q: Are connection passwords secure?**
610
+
611
+ A: The current version stores passwords in plain text in local config files. Recommendations:
612
+ 1. Don't save sensitive database connections on public computers
613
+ 2. Change database passwords regularly
614
+ 3. Use read-only accounts for daily operations
615
+ 4. Use encrypted connections (SSL/TLS) in production
616
+
617
+ **Q: How to backup connection config?**
618
+
619
+ A: Simply copy the config file:
620
+ ```bash
621
+ # Windows
622
+ copy C:\Users\YourName\.db-tool\connections.json D:\backup\
623
+
624
+ # Mac/Linux
625
+ cp ~/.db-tool/connections.json ~/backup/
626
+ ```
627
+
628
+ </details>
629
+
630
+ <details>
631
+ <summary>Update & Uninstall</summary>
632
+
633
+ **Q: How to update to the latest version?**
634
+
635
+ A: Simply reinstall:
636
+ ```bash
637
+ npm update -g fdb2
638
+ ```
639
+
640
+ **Q: How to completely uninstall?**
641
+
642
+ A: Follow these steps:
643
+ ```bash
644
+ # Uninstall
645
+ npm uninstall -g fdb2
646
+
647
+ # Delete data directory (optional, removes all connection configs)
648
+ # Windows
649
+ rmdir /s C:\Users\YourName\.db-tool
650
+
651
+ # Mac/Linux
652
+ rm -rf ~/.db-tool
653
+ ```
654
+
655
+ </details>
656
+
657
+ ### Get Help
658
+
659
+ - **GitHub Issues**: [Submit an issue](https://github.com/fefeding/fdb2/issues)
660
+ - **Documentation**: View online docs
661
+ - **Community**: Join user groups
662
+
663
+ ---
664
+
665
+ **Enjoy using fdb2 Database Management Tool! Feel free to provide feedback.**
@@ -84,8 +84,8 @@
84
84
  "isEntry": true,
85
85
  "imports": [
86
86
  "_rolldown-runtime.js",
87
- "_bootstrap.js",
88
- "_vue.js"
87
+ "_vue.js",
88
+ "_bootstrap.js"
89
89
  ],
90
90
  "dynamicImports": [
91
91
  "src/platform/database/layout.vue",
@@ -1652,6 +1652,11 @@ var init_lib = __esmMin((() => {
1652
1652
  }));
1653
1653
  //#endregion
1654
1654
  //#region node_modules/.pnpm/bootstrap@5.3.8_@popperjs+core@2.11.8/node_modules/bootstrap/dist/js/bootstrap.esm.js
1655
+ /*!
1656
+ * Bootstrap v5.3.8 (https://getbootstrap.com/)
1657
+ * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
1658
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1659
+ */
1655
1660
  /**
1656
1661
  * Private methods
1657
1662
  */
@@ -2413,7 +2418,7 @@ var init_bootstrap_esm = __esmMin((() => {
2413
2418
  CLASS_NAME_PREV = "carousel-item-prev";
2414
2419
  SELECTOR_ACTIVE = ".active";
2415
2420
  SELECTOR_ITEM = ".carousel-item";
2416
- SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;
2421
+ SELECTOR_ACTIVE_ITEM = ".active.carousel-item";
2417
2422
  SELECTOR_ITEM_IMG = ".carousel-item img";
2418
2423
  SELECTOR_INDICATORS = ".carousel-indicators";
2419
2424
  SELECTOR_DATA_SLIDE = "[data-bs-slide], [data-bs-slide-to]";