Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu48k · #5050

base

Skill này làm gì

Công cụ này giúp bạn tạo và quản lý cơ sở dữ liệu bằng LibreOffice Base. Bạn có thể xây dựng cơ sở dữ liệu mới, kết nối với cơ sở dữ liệu có sẵn, thiết kế biểu mẫu nhập liệu và tạo báo cáo.

Khi nào nên dùng

  • ✓Khi bạn tạo một danh mục khách hàng mới từ đầu.
  • ✓Khi bạn sắp xếp thông tin bán hàng thành một báo cáo.
  • ✓Khi bạn xây dựng một biểu mẫu đơn giản để đăng ký sản phẩm mới.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/libreoffice/base/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/libreoffice/base/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một cơ sở dữ liệu cho hiệu sách của tôi và thêm một bảng để ghi sách với tên, tác giả và giá.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bên trong, công cụ dùng LibreOffice Base để tạo file cơ sở dữ liệu (.odb) hoặc kết nối tới các cơ sở dữ liệu khác. Nó cho phép bạn thiết kế bảng, xây dựng biểu mẫu nhập liệu và tạo báo cáo từ dữ liệu đã lưu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

LibreOffice Base

Overview

LibreOffice Base skill for creating, managing, and automating database workflows using the native ODB (OpenDocument Database) format.

When to Use This Skill

Use this skill when:

  • Creating new databases in ODB format
  • Connecting to external databases (MySQL, PostgreSQL, etc.)
  • Automating database operations and reports
  • Creating forms and reports
  • Building database applications

Core Capabilities

1. Database Creation

  • Create new ODB databases from scratch
  • Design tables, views, and relationships
  • Create embedded HSQLDB/Firebird databases
  • Connect to external databases

2. Data Operations

  • Import data from CSV, spreadsheets
  • Export data to various formats
  • Query execution and management
  • Batch data processing

3. Form and Report Automation

  • Create data entry forms
  • Design custom reports
  • Automate report generation
  • Build form templates

4. Query and SQL

  • Visual query design
  • SQL query execution
  • Query optimization
  • Result set manipulation

5. Integration

  • Command-line automation
  • Python scripting with UNO
  • JDBC/ODBC connectivity

Workflows

Creating a New Database

Method 1: Command-Line

soffice --base

Method 2: Python with UNO

import uno

def create_database():
    local_ctx = uno.getComponentContext()
    resolver = local_ctx.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", local_ctx
    )
    ctx = resolver.resolve(
        "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"
    )
    smgr = ctx.ServiceManager
    doc = smgr.createInstanceWithContext("com.sun.star.sdb.DatabaseDocument", ctx)
    doc.storeToURL("file:///path/to/database.odb", ())
    doc.close(True)

Connecting to External Database

import uno

def connect_to_mysql(host, port, database, user, password):
    local_ctx = uno.getComponentContext()
    resolver = local_ctx.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", local_ctx
    )
    ctx = resolver.resolve(
        "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext"
    )
    smgr = ctx.ServiceManager
    
    doc = smgr.createInstanceWithContext("com.sun.star.sdb.DatabaseDocument", ctx)
    datasource = doc.getDataSource()
    datasource.URL = f"sdbc:mysql:jdbc:mysql://{host}:{port}/{database}"
    datasource.Properties["UserName"] = user
    datasource.Properties["Password"] = password
    
    doc.storeToURL("file:///path/to/connected.odb", ())
    return doc

Database Connection Reference

Supported Database Types

  • HSQLDB (embedded)
  • Firebird (embedded)
  • MySQL/MariaDB
  • PostgreSQL
  • SQLite
  • ODBC data sources
  • JDBC data sources

Connection Strings

# MySQL
sdbc:mysql:jdbc:mysql://localhost:3306/database

# PostgreSQL
sdbc:postgresql://localhost:5432/database

# SQLite
sdbc:sqlite:file:///path/to/database.db

# ODBC
sdbc:odbc:DSN_NAME

Command-Line Reference

soffice --headless
soffice --base  # Base

Python Libraries

pip install pyodbc    # ODBC connectivity
pip install sqlalchemy # SQL toolkit

Best Practices

  1. Use parameterized queries
  2. Create indexes for performance
  3. Backup databases regularly
  4. Use transactions for data integrity
  5. Store ODB source files in version control
  6. Document database schema
  7. Use appropriate data types
  8. Handle connection errors gracefully

Troubleshooting

Cannot open socket

killall soffice.bin
soffice --headless --accept="socket,host=localhost,port=8100;urp;"

Connection Issues

  • Verify database server is running
  • Check connection string format
  • Ensure JDBC/ODBC drivers are installed
  • Verify network connectivity

Resources

Related Skills

  • writer
  • calc
  • impress
  • draw
  • workflow-automation

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

Tôi có cần cài đặt LibreOffice Base không?

Có, công cụ này yêu cầu LibreOffice Base đã được cài trên máy tính của bạn.

Tôi có thể kết nối với cơ sở dữ liệu như MySQL không?

Có, bạn có thể kết nối với nhiều loại cơ sở dữ liệu bên ngoài, như MySQL và PostgreSQL.

Làm sao để tạo báo cáo?

Bạn có thể yêu cầu tạo báo cáo dựa trên các bảng và dữ liệu đã nhập vào cơ sở dữ liệu.

Chi tiết

Mô tả gốc của tác giả

Database management, forms, reports, and data operations with LibreOffice Base.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5050
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự