-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This pull request cleans up the `delta-table` package in order to prepare the implementation of a library for working with SQL tables. Specifically, this pull requests * Splits off existing code into a `delta-chain` package, to be cleaned up later. * Removes most modules from the `delta-table` package. ### Issue Number ADP-2565
- Loading branch information
Showing
15 changed files
with
770 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Overview | ||
|
||
At the time of this writing, the package contains | ||
an early prototype of a `Table` type that represents | ||
database tables, and an example usage can be found in `Data.Chain`. | ||
|
||
The main modules are: | ||
|
||
* [Data.Table](src/Data/Table.hs) — database | ||
* Contains the `Table` dataype, which models a table as you would find it in a database. | ||
* [Data.Chain](src/Data/Delta.hs) — (block)chain | ||
* Contains the `Chain` datatype, which is more specific | ||
to the problem domain of storing a linear sequence | ||
of checkpoints. Useful in a blockchain setting. | ||
|
||
In addition, this package contains | ||
* [Database.Persist.Delta](src/Database/Persist/Delta.hs) — database | ||
* Implements a `Store` in an SQLite database for the `Entity` types in the `persistent` package. | ||
* Implements a `Store` using raw SQL commands. | ||
* [Database.Schema](src/Database/Schema.hs) — database | ||
* Contains the `IsRow` type class for typed database rows, very similar to the style of the [servant](https://hackage.haskell.org/package/servant) package. | ||
* Example: `type PersonRow = Table "person" :. Col "name" Text :. Col "birth" Int :. Col "id" Primary`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
cabal-version: 3.6 | ||
build-type: Simple | ||
name: delta-chain | ||
version: 0.2024.5.5 | ||
synopsis: Example for storing a chain in a database, using delta types. | ||
description: Please see README.md | ||
homepage: https://github.com/cardano-foundation/cardano-wallet | ||
license: Apache-2.0 | ||
author: Cardano Foundation (High Assurance Lab) | ||
maintainer: hal@cardanofoundation.org | ||
copyright: 2023-2024 Cardano Foundation | ||
category: Database | ||
|
||
extra-source-files: | ||
README.md | ||
|
||
common language | ||
default-language: | ||
Haskell2010 | ||
default-extensions: | ||
NoImplicitPrelude | ||
OverloadedStrings | ||
|
||
common opts-lib | ||
ghc-options: | ||
-Wall -Wcompat | ||
-Wredundant-constraints | ||
-Wincomplete-uni-patterns -Wincomplete-record-updates | ||
|
||
if flag(release) | ||
ghc-options: -O2 -Werror | ||
|
||
common opts-exe | ||
import: opts-lib | ||
ghc-options: -threaded -rtsopts | ||
|
||
flag release | ||
description: Enable optimization and `-Werror` | ||
default: False | ||
manual: True | ||
|
||
library | ||
import: language, opts-lib | ||
hs-source-dirs: src | ||
build-depends: | ||
base | ||
, conduit | ||
, containers | ||
, delta-store | ||
, delta-types | ||
, exceptions | ||
, generic-lens | ||
, io-classes | ||
, monad-logger | ||
, persistent | ||
, persistent-sqlite | ||
, say | ||
, semigroupoids | ||
, stm | ||
, text | ||
, transformers | ||
hs-source-dirs: | ||
src | ||
exposed-modules: | ||
Data.Chain | ||
Data.Table | ||
Database.Persist.Delta | ||
Database.Schema | ||
other-modules: | ||
Demo.Database | ||
|
||
test-suite unit | ||
import: language, opts-exe | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test/unit | ||
main-is: Main.hs | ||
build-tool-depends: | ||
hspec-discover:hspec-discover | ||
build-depends: | ||
base | ||
, hspec |
File renamed without changes.
Oops, something went wrong.