Skip to content

Instantly share code, notes, and snippets.

View kubo's full-sized avatar

Kubo Takehiro kubo

  • Japan
View GitHub Profile
/*
* Copy this file to the root directory of snzip source tree and compile it as follows:
*
* gcc -o crc32_test crc32_test.c crc32.c crc32_sse4_2.c -msse4.2
*/
#include <stdio.h>
#include "crc32.h"
/* See https://tools.ietf.org/html/rfc3720#appendix-B.4 */
typedef struct {
@kubo
kubo / query_as_json.rs
Created January 17, 2024 12:32
fetch rows as serde_json::Value
use oracle::{sql_type::OracleType, sql_type::ToSql, Connection, ResultSet, Row};
use std::str::FromStr;
// Usage:
//
// // conn is oracle::Connection.
// for json_result in query_as_json(&conn, sql, &[])? {
// // json_result is std::result::Result<serde_json::Value, oracle::Error>.
// let json = json_result?;
// println!("{}", json);