iconDreamine
← 목록

Dreamine.Database.Oracle

stablev1.0.1

Oracle DB 전용 드라이버 및 시퀀스 지원.

#database#oracle
TFM net8.0Package Dreamine.Database.Oracle참조 Dreamine.Database.Abstractions, Dreamine.Database.Core

Dreamine.Database.Oracle

Dreamine.Database.Oracle은 Dreamine Database 패키지군의 Oracle Provider입니다.

English documentation

패키지 역할

이 패키지는 Oracle.ManagedDataAccess.Core를 사용해서 Oracle용 IDatabaseProvider를 구현합니다.

Dreamine.Database.Abstractions
        ↑
Dreamine.Database.Core
        ↑
Dreamine.Database.Oracle

주요 기능

  • Oracle Connection 생성
  • : 기반 Oracle Parameter Prefix 지원
  • 대문자 Quoted Identifier
  • Oracle Type Mapping
  • Identity Column Table 생성
  • 공통 DatabaseProviderBase 기반 CRUD

빠른 시작

using Dreamine.Database.Oracle;

var provider = new OracleDatabaseProvider(
    "User Id=dreamine;Password=password;Data Source=localhost:1521/XEPDB1;");

provider.EnsureDatabaseExists();
provider.CreateTable<SampleCustomer>();
provider.Insert(new SampleCustomer
{
    Name = "Dreamine",
    Role = "Operator",
    CreatedAt = DateTime.Now
});

Schema 참고

Oracle은 보통 애플리케이션 Connection String으로 Database를 생성하기보다, 미리 만든 사용자/Schema에 접속하는 방식으로 사용합니다. 먼저 사용자/Schema를 준비하고 해당 계정에 Table 생성 권한을 부여하세요.

의존성

  • Dreamine.Database.Abstractions
  • Dreamine.Database.Core
  • Oracle.ManagedDataAccess.Core

대상 프레임워크

net8.0

샘플 및 테스트

  • 단위 테스트: 20_SOURCES/200. Tests/Dreamine.FullKit.Tests/Database
  • WPF 샘플: 20_SOURCES/998. DEMO/000. Sample/010. Wpfs/SampleSmart/Pages/PageSub/PageDatabase.xaml

라이선스

MIT License

구조 다이어그램

classDiagram
    class OracleConnectionFactory {
        -string _connectionString
        +Create() IDbConnection
        +CreateAsync() Task~IDbConnection~
    }
    class OracleRepository~T~ {
        +GetAsync(int) Task~T~
        +GetAllAsync() Task~IEnumerable~T~~
        +AddAsync(T) Task
        +UpdateAsync(T) Task
        +DeleteAsync(int) Task
        -BuildOracleSql(T) string
    }
    class OracleUnitOfWork {
        +BeginTransaction() Task
        +CommitAsync() Task
        +RollbackAsync() Task
    }
    class OracleServiceExtensions {
        <<static>>
        +AddOracle(IServiceCollection, string) IServiceCollection
    }
    class RepositoryBase~T~ {
        <<abstract>>
    }
    RepositoryBase~T~ <|-- OracleRepository~T~
    OracleRepository~T~ --> OracleConnectionFactory

API 문서

타입

OracleDatabaseProvider

\if KO Oracle용 Dreamine 데이터베이스 공급자 구현을 제공합니다. \endif \if EN Provides a Dreamine database-provider implementation for Oracle. \endif

OracleDatabaseProvider

#ctor Method

\if KO 지정한 연결 문자열로 의 새 인스턴스를 초기화합니다. \endif \if EN Initializes a new instance with the specified connection string. \endif

connectionString— \if KO Oracle 연결 문자열입니다. \endif \if EN The Oracle connection string. \endif
BuildCreateTableSql Method

\if KO IDENTITY 키를 지원하는 Oracle CREATE TABLE SQL을 만듭니다. \endif \if EN Builds Oracle CREATE TABLE SQL with identity-key support. \endif

map— \if KO 테이블 엔터티 매핑입니다. \endif \if EN The table entity map. \endif

반환: \if KO Oracle CREATE TABLE SQL입니다. \endif \if EN The Oracle CREATE TABLE SQL. \endif

CreateConnection Method

\if KO 구성된 연결 문자열을 사용하는 새 Oracle 연결을 만듭니다. \endif \if EN Creates a new Oracle connection using the configured connection string. \endif

반환: \if KO 닫힌 Oracle 연결입니다. \endif \if EN A closed Oracle connection. \endif

GetSqlType Method

\if KO CLR 속성 형식을 대응하는 Oracle 열 형식으로 변환합니다. \endif \if EN Converts a CLR property type to its corresponding Oracle column type. \endif

property— \if KO 변환할 속성 매핑입니다. \endif \if EN The property mapping to convert. \endif

반환: \if KO Oracle 열 형식 선언입니다. \endif \if EN The Oracle column-type declaration. \endif

IsTableExists Method

\if KO 현재 Oracle 스키마에 지정한 테이블이 존재하는지 확인합니다. \endif \if EN Determines whether the specified table exists in the current Oracle schema. \endif

tableName— \if KO 확인할 테이블 이름입니다. \endif \if EN The table name to inspect. \endif

반환: \if KO 테이블 존재 여부입니다. \endif \if EN Whether the table exists. \endif

IsTableExistsAsync Method

\if KO 현재 Oracle 스키마에 지정한 테이블이 존재하는지 비동기적으로 확인합니다. \endif \if EN Asynchronously determines whether the specified table exists in the current Oracle schema. \endif

tableName— \if KO 확인할 테이블 이름입니다. \endif \if EN The table name to inspect. \endif
cancellationToken— \if KO 조회 취소 토큰입니다. \endif \if EN A token used to cancel the query. \endif

반환: \if KO 테이블 존재 여부를 결과로 제공하는 작업입니다. \endif \if EN A task whose result indicates whether the table exists. \endif

QuoteIdentifier Method

\if KO Oracle 큰따옴표 문법으로 대문자 식별자를 안전하게 인용합니다. \endif \if EN Safely quotes an upper-case identifier using Oracle double-quote syntax. \endif

identifier— \if KO 인용할 식별자입니다. \endif \if EN The identifier to quote. \endif

반환: \if KO 이스케이프하고 인용한 식별자입니다. \endif \if EN The escaped and quoted identifier. \endif

Kind Property

\if KO Oracle 공급자 종류를 가져옵니다. \endif \if EN Gets the Oracle provider kind. \endif

ParameterPrefix Property

\if KO Oracle 바인드 변수에 사용하는 콜론 접두사를 가져옵니다. \endif \if EN Gets the colon prefix used for Oracle bind variables. \endif