@pgxsinkit/pgwasm
=================

This package includes software that began as a copy of third-party code. It is owned
outright and diverges freely (ADR-0062); these attributions are permanent.

------------------------------------------------------------------------------
ElectricSQL — @electric-sql/pglite (packages `pglite`, `pg-protocol`, `pglite-utils`)
------------------------------------------------------------------------------

The Postgres runtime under `packages/pgwasm/src/` (`@pgxsinkit/pgwasm`) and the C
build's host code under `packages/pgwasm-c/src/` (`@pgxsinkit/pgwasm-c`) began as a
copy of ElectricSQL's PGlite monorepo:

  Source:  https://github.com/electric-sql/pglite
  License: PostgreSQL License. PGlite is dual-licensed under the Apache License 2.0
           and the PostgreSQL License, at the licensee's choice; pgxsinkit takes it
           under the PostgreSQL License.
  Copyright (c) ElectricSQL and contributors

The code is owned outright (ADR-0062) and diverges freely; compatibility with PGlite
is an explicit anti-goal. This attribution is retained because the code began as a
copy. The PostgreSQL License text, as PGlite ships it (POSTGRES-LICENSE):

  Copyright (c) ElectricSQL and contributors

  PostgreSQL Database Management System
  (formerly known as Postgres, then as Postgres95)

  Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group

  Portions Copyright (c) 1994, The Regents of the University of California

  Permission to use, copy, modify, and distribute this software and its
  documentation for any purpose, without fee, and without a written agreement
  is hereby granted, provided that the above copyright notice and this
  paragraph and the following two paragraphs appear in all copies.

  IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
  DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
  LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
  DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
  PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

------------------------------------------------------------------------------
node-postgres — pg-protocol (via ElectricSQL's `@electric-sql/pg-protocol`)
------------------------------------------------------------------------------

The wire-protocol codec under `packages/pgwasm/src/protocol/wire/` began as a copy of
ElectricSQL's `@electric-sql/pg-protocol`, itself adapted from Brian Carlson's
node-postgres `pg-protocol`. ElectricSQL's changes are taken under the PostgreSQL
License (the PGlite entry above); the original is MIT-licensed:

  Source:  https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol
  License: MIT

  MIT License

  Copyright (c) 2010 - 2021 Brian Carlson

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.

------------------------------------------------------------------------------
Drizzle Team — drizzle-orm, driver `drizzle-orm/pglite`
------------------------------------------------------------------------------

The Drizzle driver under `packages/pgwasm/src/drizzle/` (`@pgxsinkit/pgwasm/drizzle`)
began as a copy of drizzle-orm's PGlite driver (`src/pglite/driver.ts`,
`src/pglite/session.ts`, `src/pglite/codecs.ts` at 1.0.0-rc.4), rebound to pgwasm:

  Source:  https://github.com/drizzle-team/drizzle-orm
  License: Apache License 2.0
  Copyright (c) Drizzle Team and contributors

Changes: the session, transaction and database classes are rebound from PGlite to
pgwasm; the driver never constructs its own database; it has its own JIT capability
probe; `$cache.invalidate` is bound without changing the caller's cache. The Apache-2.0 terms are
permanent. A copy of the Apache License 2.0 ships with this package in
LICENSE-APACHE-2.0 (from https://www.apache.org/licenses/LICENSE-2.0.txt).

------------------------------------------------------------------------------
postgres.js — type parsers and serializers
------------------------------------------------------------------------------

`packages/pgwasm/src/types.ts` is based on postgres.js `types.js`, which is published
under the Unlicense (no conditions; credited as a courtesy):

  Source:  https://github.com/porsager/postgres/blob/master/src/types.js
  License: The Unlicense
