Leírás/Description:
-
Linux/mac:
- Visit the
https://github.com/simsononroad/easy_sqlite_db/releases/tag/0.1
url - Download the
start.sh
file to the folder where you want to work - give
run as program
to thestart.sh
- run in the terminal whit the
./start.sh
command
- Visit the
-
Windows:
- Visit the
https://github.com/simsononroad/easy_sqlite_db/releases/tag/w0.1
url - Download the
start.bat
file to the folder where you want to work - run the
start.bat
file
- Visit the
- Create table:
[variable name] = create("[database name].db", [True/False])
- -> first index: database_name.db
- -> second index:
True
: It will print out the logFalse
: This will not log out anything
function call: [variable name].[function name](function parameters)
-
init_db(database_name)
- -> database_name:
str
- -> database_name:
-
create_table(table_name, columns)
- -> database_name:
str
- -> table_name:
str
- -> columns:
list
- -> database_name:
-
add_element(table_name, columns, content)
- -> database_name:
str
- -> table_name:
str
- -> columns:
list
- -> content:
list
- -> database_name:
-
select_item(table_name, columns)
, return -> Items- -> database_name:
str
- -> table_name:
str
- -> columns:
list
- -> database_name:
-
update_row(table_name, coloumn_name, new_value, condition)
- -> database_name:
str
- -> table_name:
str
- -> coloumn_name:
str
- -> new_value:
str
/int
- -> condition:
str
- -> database_name:
-
delete_row(table_name, condition)
-
-> database_name:
str
-
-> table_name:
str
-
-> condition:
str
-
condition example
[column name] : '[value]'
name: 'jack'
-
-
get_db_info(table_name, coloumn_name)
- -> table name:
str
- -> coloumn_name:
list
- return:tuple -> firs: database name || second: coloumns_name || third: number of rows || fourth: number of coloumns (coloumns with the ID coloumn)
- -> table name:
-
This can help for the developers when they want to start the code quickly
-
quick_start(coloumn_name)
- -> coloumn_name:
list
- Description
- This will creat the database with
database.db
name and the table withtables
name
- This will creat the database with
- -> coloumn_name:
-
quick_add(coloumn_name, contents)
- -> coloumn_name:
list
- -> contents:
list
- -> coloumn_name:
-
quick_select(coloumn_name)
- -> coloumn_name:
list
- -> coloumn_name:
-
quick_delete(condition)
-
condition example
[coloumn name] : '[value]'
name: 'david'
-
-
Linux/mac:
- Látogass el a
https://github.com/simsononroad/easy_sqlite_db/releases/tag/0.1
URL-re - Töltsd le a
start.sh
fájlt abba a mappába, ahol dolgozni szeretnél - Adj futtatási jogosultságot a
start.sh
fájlnak - Futtasd a terminálban a
./start.sh
parancs segítségével
- Látogass el a
-
Windows:
- Látogass el a
https://github.com/simsononroad/easy_sqlite_db/releases/tag/w0.1
URL-re - Töltsd le a
start.bat
fájlt abba a mappába, ahol dolgozni szeretnél - Futtasd a
start.bat
fájlt
- Látogass el a
- Tábla létrehozása:
[változó név] = create("[adatbázis név].db", [True/False])
- -> ELső index: database_name.db
- -> Második index:
True
: Ki fogja írni hogy mit hajtott végreFalse
: Nem fogja ki írni hogy mit hajtott végre
Függvény meghívása: [változó név].[függvény neve](függvény paraméterei)
-
init_db(database_name)
- -> database_name:
str
- -> database_name:
-
create_table(table_name, columns)
- -> database_name:
str
- -> table_name:
str
- -> columns:
list
- -> database_name:
-
add_element(table_name, columns, content)
- -> database_name:
str
- -> table_name:
str
- -> columns:
list
- -> content:
list
- -> database_name:
-
select_item(table_name, columns)
, visszatérési érték ->list
- -> database_name:
str
- -> table_name:
str
- -> columns:
str
- -> database_name:
-
update_row(table_name, coloumn_name, new_value, condition)
- -> database_name:
str
- -> table_name:
str
- -> coloumn_name:
str
- -> new_value:
str
/int
- -> condition:
str
- -> database_name:
-
delete_row(table_name, condition)
-
-> database_name:
str
-
-> table_name:
str
-
-> condition:
str
-
condition example
[oszlop neve] : '[érték]'
nev: 'david'
-
-
get_db_info(table_name, coloumn_name)
- -> table name:
str
- -> coloumn_name:
list
- return: tuple -> első elem: adatbázis neve || második elem: oszlopok neve || harmadik elem: sorok száma || negyedik elem: oszlopk száma
- -> table name:
-
Ez segíthet a fejlesztőknek ha csak tesztelni szeretnének és nem akarnak a nevekkel bajlódni
-
quick_start(coloumn_name)
- -> coloumn_name:
list
- Description
- Ez megfogja csinálni az adatbázist
database.db
néven és létrehoz egy tábláttables
néven.
- Ez megfogja csinálni az adatbázist
- -> coloumn_name:
-
quick_add(coloumn_name, contents)
- -> coloumn_name:
list
- -> contents:
list
- -> coloumn_name:
-
quick_select(coloumn_name)
- -> coloumn_name:
list
- -> coloumn_name:
-
quick_delete(condition)
-
condition example
[oszlop neve] : '[érték]'
name: 'david'
-
from easy_db import *
# Create database
database = create("databse1.db")
print(create.version)
# Create database
database.init_db()
#create table
database.create_table("tabla1", ["name", "age"])
#Add item to database
database.add_element(table_name="tabla1", coloumn_name=["name", "age"], contents=["Jack", 15])
database.add_element(table_name="tabla1", coloumn_name=["name", "age"], contents=["david", 10])
#replace item in database
database.update_row("tabla1", coloumn_name="name", new_value="kispista", condition="id=1")
#Delete item from database
database.delete_row(table_name="tabla1", condition="name='Jack'")
#Return important infos from database
infos = database.get_db_info("tabla1", coloumn_name=["name", "age"])
temp = templates(db_name="temp.db", debug_mode=True)
temp.shop()
temp.chat()
temp.login()