New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mdb-bp

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdb-bp

blockpoint Systems - MultiVersion Database (MDB) ODBC

pipPyPI
Version
1.0.3
Maintainers
1

mdb-bp

Table of Contents

  • Requirements
  • Installation
  • Documentation
  • Example

This package contains a pure-Python MDB client library.

Requirements

  • Python >= 3.9.0
  • MDB >= 1.0

Installation

Package is uploaded on PyPI.

Install with pip:

$ python3 -m pip install mdb-bp

Documentation

bSQL documentation is available online:https://bsql.org/

For support, please refer to StackOverflow.

Example

The following example makes use of a simple blockchain, inserts a value, and reads that value.


from mdb_bp import driver

# Connect to the database
conn = driver.connect(
    username="user",
    password="password",
    connection_protocol="tcp",
    server_address="216.27.61.137",
    server_port=8080,
    database_name="master",
    parameters={"interpolateParams": True},
)

# Prepare a statement
stmt = conn.prepare(
    "CREATE BLOCKCHAIN user TRADITIONAL ("
    + "id uint64 PRIMARY KEY AUTO INCREMENT,"
    + " first_name string size = 25 PACKED,"
    + " last_name string size = 50 PACKED,"
    + " age uint8,"
    + " username string size=30 PACKED UNIQUE)")

# Execute the statement.
resp = stmt.exec()
print(resp)

# Run an insertion and handle error
xact = conn.begin()

# Insert a value non-atomically
try:
    result = xact.exec(
        "INSERT user (first_name, last_name, age, username) "
        + "VALUES (\"it's NOT CHABOY\", \"Smith\", 45, \"NOT CHABOY\")")
    print(result)
    xact.commit()

except Exception as err:
    # Rollback the transaction if there was a failure
    print(err)
    xact.rollback()

# Query from the blockchain
rows = conn.query("SELECT * FROM user")

# Print the rows
itr = iter(rows)

for row in itr:
    print(row)

# Store a file
store_file_resp = conn.store_file(
    "space",
    "test_files/space.png",
    "png"
)
print(store_file_resp)

# Export a file 
export_file_resp = conn.export_file(
    "space",
    "test_files/out_space.png",
    "png"
)
print(export_file_resp)

Resources

Keywords

blockpoint

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts