Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

java.time interop

オープン
#46 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
clojure, java
領域
database

調査の方向性

まず、clojure.jdbc にある既存の ISQLType および ISQLResultSetReadColumn プロトコル実装を調査し、次に提案されている java.time のマッピングと比較します。要求された java.time 相互運用ファイルを追加し、LocalDate、LocalTime、LocalDateTime の値が対応する JDBC 型との間でマッピングされることを検証します。

索引モデルが issue の本文から書いたものです。

説明

Would be great to have a file like

;; clojure.java-time

  (:require
    [java-time]
    [jdbc.proto :refer [ISQLType ISQLResultSetReadColumn]])

; java.time.LocalDate     - java.sql.Date
; java.time.LocalDateTime - java.sql.Timestamp
; java.time.LocalTime     - java.sql.Time

(extend-protocol ISQLType
  ;
  java.time.LocalDate
  (as-sql-type [this conn]
    (java-time/sql-date this))
  (set-stmt-parameter! [this conn stmt index]
    (.setDate stmt index
      (java-time/sql-date this)))

  java.time.LocalTime
  (as-sql-type [this conn]
    (java-time/sql-time this))
  (set-stmt-parameter! [this conn stmt index]
    (.setTime stmt index
      (java-time/sql-time this)))

  java.time.LocalDateTime
  (as-sql-type [this conn]
    (java-time/sql-timestamp this))
  (set-stmt-parameter! [this conn stmt index]
    (.setTimestamp stmt index
      (java-time/sql-timestamp this))))
  ;
;

(extend-protocol ISQLResultSetReadColumn
  ;
  java.sql.Timestamp
  (from-sql-type [this conn metadata index]
    (java-time/local-date-time this))
  ;
  java.sql.Date
  (from-sql-type [this conn metadata index]
    (java-time/local-date this))
  ;
  java.sql.Time
  (from-sql-type [this conn metadata index]
    (java-time/local-time this)))
;

to make java.time support easier.

主要言語
Clojure
スター
106
フォーク
23
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

funcool/clojure.jdbc のほかの issue

funcool/clojure.jdbc の issue をすべて見る

似ている issue

Clojure の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。