{"id":18053914,"url":"https://github.com/hymkor/oluacle","last_synced_at":"2025-08-12T06:08:26.479Z","repository":{"id":82954796,"uuid":"230643567","full_name":"hymkor/oluacle","owner":"hymkor","description":"Lua for Oracle (executable/dynamic link library for Windows)","archived":false,"fork":false,"pushed_at":"2019-12-28T18:15:08.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T08:26:05.369Z","etag":null,"topics":["lua","oracle","oracle-database"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hymkor.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-28T17:51:30.000Z","updated_at":"2023-04-23T09:35:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"44c9963d-93f5-485a-bad0-b06583c7eee3","html_url":"https://github.com/hymkor/oluacle","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hymkor/oluacle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Foluacle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Foluacle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Foluacle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Foluacle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hymkor","download_url":"https://codeload.github.com/hymkor/oluacle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Foluacle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270011175,"owners_count":24511896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","oracle","oracle-database"],"created_at":"2024-10-31T00:08:31.940Z","updated_at":"2025-08-12T06:08:26.421Z","avatar_url":"https://github.com/hymkor.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Oluacle - Lua for Oracle\r\n========================\r\n\r\n`oluacle` is a library to access Oracle database.\r\n\r\nDiffences from LuaSQL are:\r\n\r\n* Bind-variable supported.\r\n* Few Lines required to access database\r\n* Supports Oracle-database only.\r\n\r\nOluacle are executable and library's set.\r\n\r\n* Executable: (oluacle.exe[Windows])\r\n    * Include lua interpretor.\r\n* Library: (oluacle.dll / oluacle.so)\r\n    * Standard Lua interpretor can include it with 'require' statement.\r\n\r\nSample\r\n======\r\n\r\nOne-liner\r\n---------\r\n\r\nPrint a list of tables which `HR` -- Oracle Express Edition's sample user -- owns.\r\n\r\n### Windows\r\n\r\nCall Excutable on command prompt:\r\n\r\n    C:\u003e oluacle.exe -e \"for rs in oluacle.new('HR','HR'):exec('select * from tab') do print(rs.TNAME) end\"\r\n\r\n- On standard lua intepretor, include library:\r\n\r\n    C:\u003e lua.exe -e \"for rs in require('oluacle').new('HR','HR'):exec('select * from tab') do print(rs.TNAME) end\"\r\n\r\n### Linux\r\n\r\ninclude library:\r\n\r\n    $ lua -e 'for rs in require('oluacle').new(\"HR\",\"HR\"):exec(\"select * from tab\") do print(rs.TNAME) end'\r\n\r\n\r\nAnother sample\r\n--------------\r\n\r\nprint a list of tablespaces\r\n\r\n### SOURCE:\r\n\r\n    conn=(oluacle or require('oluacle')).new(arg[1],arg[2])\r\n\r\n    print((\"%-10s %15s %15s\"):format(\"TABLESPACE\",\"ALLSIZE[KB]\",\"FREESIZE[KB]\"))\r\n    print(\"------------------------------------------\")\r\n    for rs in conn:exec([[\r\n            SELECT  t.TABLESPACE_NAME   as TABLESPACE_NAME ,\r\n                    TRUNC(NVL(SUM(d.BYTES),0)/1024) as KBYTES ,\r\n                    TRUNC(NVL(SUM(f.BYTES),0)/1024) as KFREE\r\n             FROM  sys.dba_tablespaces t,\r\n                   sys.dba_data_files  d,\r\n                   sys.dba_free_space  f\r\n             WHERE  t.TABLESPACE_NAME = d.TABLESPACE_NAME \r\n               AND  t.TABLESPACE_NAME = f.TABLESPACE_NAME(+)\r\n          GROUP BY t.rowid, t.TABLESPACE_NAME\r\n          ORDER BY t.rowid\r\n    ]]) do\r\n        print((\"%-10s %15d %15d\"):format(\r\n            rs.TABLESPACE_NAME , rs.KBYTES , rs.KFREE ))\r\n    end\r\n    print(\"------------------------------------------\")\r\n\r\n    conn:disconnect()\r\n\r\n### OUTPUT\r\n\r\n    $ lua dbfree.lua (DBA-username) (password)\r\n    TABLESPACE     ALLSIZE[KB]    FREESIZE[KB]\r\n    ------------------------------------------\r\n    SYSTEM              696320            2496\r\n    UNDO                460800           76928\r\n    SYSAUX            10106880           21632\r\n    USERS               921600          100416\r\n    ------------------------------------------\r\n    $\r\n\r\n\r\nInstall\r\n=======\r\n\r\n### Windows\r\n\r\n- put oluacle.dll and oluacle.exe on the one directory of \r\n  directories pointed %PATH%.\r\n\r\n### Linux\r\n\r\n    make -f Makefile.lin\r\n    (requires lua-5.2.0)\r\n\r\n\r\nSyntax\r\n======\r\n\r\nrequire 'oluacle'\r\n-------------------------\r\n\r\nLoad oluacle.dll or oluacle.so  and  return the table with the method 'new' \r\nto connect database.\r\n\r\n    oluacle = require('oluacle')\r\n\r\nOn oluacle.exe, it has not to do 'require'. The symbol 'oluacle' is used.\r\n\r\noluacle.new\r\n-----------\r\n\r\nConnect a Oracle-database and return connection-object.\r\n\r\n    conn = oluacle.new('USERNAME','PASSWORD'[,'DBNAME'][,OPTIONTABLE])\r\n\r\nWhen connection failed, error occurs.\r\n\r\nOPTIONTABLE :\r\n\r\n    { null=VALUE }\r\n        Value used as NULL. default value is false.\r\n        You can not set nil.\r\n\r\n\r\nCONN:exec\r\n---------\r\n\r\nExecute SQL. conn is the return-value of oluacle.new\r\nWhen SQL is 'SELECT', it returns iterator and statement-handle.\r\nWhen SQL is 'INSERT','UPDATE' or 'DELETE', it returns the number of records.\r\n\r\n    ITERATOR,BUFFER = conn:exec(SQL-STRING,B1,B2...)\r\n\r\nor\r\n\r\n    ITERATOR,BUFFER = conn:exec(SQL-STRING,{V1=B1,V2=B2...} )\r\n\r\nB1,B2 are values for bind-variables. V1,V2 are names of bind-variables.\r\n\r\nYou call this with generic-for.\r\n\r\n    for rs in conn:exec(SQL-STRING,B1,B2...) do\r\n       :\r\n    end\r\n\r\nThe table-variable 'rs' has values which you can access with 3-styles:\r\n\r\n    (1) rs[1], rs[2] ...\r\n    (2) rs.COLUMNNAME1, rs.COLUMNNAME2 ...\r\n    (3) rs[\"COLUMNNAME1\"] , rs[\"COLUMNNAME2\"]\r\n\r\n- NULL value is represented with 'false' by default.\r\n  'new' method can change it with { null=... } except for nil.\r\n\r\n- DATE value is represented with string formated 'YYYY/MM/DD HH24:MI:SS'\r\n\r\n\r\nCONN:commit , CONN:rollback , CONN:disconnect\r\n---------------------------------------------\r\n\r\n`CONN:commit()` does commit database.\r\n`CONN:disconnect()` rolls back database and disconnect.\r\nWhen CONN is collected as garbage, CONN:disconnect is called. \r\n\r\n\r\nTO DO\r\n=====\r\n\r\n* function to trap error.\r\n* BLOB\r\n\r\n\r\nBug report\r\n==========\r\n\r\nThis package is tested on these softwares.\r\n\r\n* WindowsXP SP3\r\n* Mingw\r\n* Oracle 10g Express Edition.\r\n\r\n* Fedora 10\r\n* Oracle 11g Instant Client\r\n\r\nWhen you find bugs or have a question, please mail to iyahaya@nifty.com.\r\n\r\nYou can copy and modify oluacle with MIT License.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhymkor%2Foluacle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhymkor%2Foluacle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhymkor%2Foluacle/lists"}