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
import { decrypt, encrypt, generatePrivate, getPublic } from "eccrypto"; | |
// setup | |
let privateKey = generatePrivate(); | |
let publicKey = getPublic(privateKey); | |
let frontendPublicKey = publicKey.toString("hex"); | |
let backendPrivateKey = privateKey.toString("hex"); | |
console.log({ |
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
import alphaorm.AlphaORM as DB | |
# Create new Record | |
product = DB.create('product') | |
product.name = 'Running shoes' | |
product.price = 5000 | |
DB.store(product) |
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
import alphaorm.AlphaORM as DB | |
DB.setup('mysql',{ | |
'host' : 'localhost', | |
'user' : 'root', | |
'password' : '', | |
'database' : 'alphaorm' | |
}) |
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
const { AlphaORM: DB } = require('alpha-orm') | |
// Create new Record | |
(async function () { | |
product = await DB.create('product') | |
product.name = 'Running shoes' | |
product.price = 5000 | |
await DB.store(product) | |
})() |
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
const { AlphaORM: DB } = require('alpha-orm') | |
// MySQL | |
DB.setup('mysql',{ | |
host : 'localhost', | |
user : 'root', | |
password : '', | |
database : 'alphaorm' | |
}) |
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
<?php | |
use ALphaORM\ALphaORM as DB; | |
# Create new Record | |
$product = DB::create('product'); | |
$product->name = 'Running shoes'; | |
$product->price = 5000; | |
DB::store($product); // Stores the data in the database | |
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
<?php | |
use ALphaORM\ALphaORM as DB; | |
# Setting up COnnection to database | |
#MySQL | |
DB::setup('mysql',[ | |
'host' => 'localhost', | |
'user' => 'root', | |
'password' => '', |