Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

preserve data after database instance restart #247

Merged
merged 3 commits into from
Aug 23, 2020

Conversation

alex-dukhno
Copy link
Owner

Closes #38

Description

database use on disk persistence if it is run with PERSISTENT=1 env variable

Client output

user can work with previous dataset if start database with the following command PERSISTENT=1 RUST_LOG=debug cargo run

$ psql -h 127.0.0.1 -W
Password:
psql (12.3, server 0.0.0)
Type "help" for help.

alex-dukhno=> create schema schema_name;
CREATE SCHEMA
alex-dukhno=> create table schema_name.table_name (col1 integer);
CREATE TABLE
alex-dukhno=> insert into schema_name.table_name values (1);
INSERT 0 1
alex-dukhno=> select * from schema_name.table_name;
 col1
------
    1
(1 row)

alex-dukhno=> \q

after quitting psql and reconnecting to database

psql -h 127.0.0.1 -W
Password:
psql (12.3, server 0.0.0)
Type "help" for help.

alex-dukhno=> select * from schema_name.table_name;
 col1
------
    1
(1 row)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 221036323

  • 28 of 130 (21.54%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-1.5%) to 82.93%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/node/src/node.rs 0 1 0.0%
src/storage/src/persistent.rs 17 34 50.0%
src/sql_engine/src/catalog_manager/mod.rs 0 21 0.0%
src/sql_engine/src/catalog_manager/data_definition.rs 8 71 11.27%
Files with Coverage Reduction New Missed Lines %
src/storage/src/persistent.rs 1 74.12%
Totals Coverage Status
Change from base Build 220964973: -1.5%
Covered Lines: 4416
Relevant Lines: 5325

💛 - Coveralls

@alex-dukhno alex-dukhno merged commit 993af1f into master Aug 23, 2020
@alex-dukhno alex-dukhno deleted the preserve-data-after-database-restart branch August 23, 2020 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve data inside storage after restart
2 participants