專為 PostgreSQL 設計的 ORM 框架,Pomm 1.0

fmms 13年前發布 | 6K 次閱讀 PostgreSQL

Pomm 是一個輕量級、快速、高效而且強大的 PHP 對象映射框架,專為 PostgreSQL 設計。由于只支持 PostgreSQL,Pomm 利用了 PostgreSQL 本身的豐富特性,性能非常強勁,功能很強大。

Pomm 只支持 PHP 5.3。

SELECT author FROM author;
| author |
+-------------------+
| "(1,'john doe')" |
+-------------------+
| "(2,'Edgar')" |
+-------------------+

SELECT
  author.id,
  author.name,
  array_agg(post) AS posts
FROM
  author
    LEFT JOIN post ON
        author.id = post.author_id
GROUP BY
  author.id;
| id | name | posts |
+----+----------+----------------------------------------+
| 1 | John Doe | {"(1,'first post')","(2,'new post')"} |
+----+----------+----------------------------------------+
| 2 | Edgar | {"(3,'Hello world')"} |
+----+----------+----------------------------------------+

Pomm 發布 1.0 版本了,該版本重寫了轉化系統模塊,可處理 Pg 的數組和對象;可處理虛擬字段,更新了相應的類生成模塊。

 本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!