mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-26 14:49:57 +00:00
I've also started `ASYNC_MIGRATION.MD` to keep track of the breaking changes from sync to async python.
34 lines
1.1 KiB
Rust
34 lines
1.1 KiB
Rust
// Copyright 2024 Lance Developers.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
use connection::{connect, Connection};
|
|
use env_logger::Env;
|
|
use pyo3::{pymodule, types::PyModule, wrap_pyfunction, PyResult, Python};
|
|
|
|
pub mod connection;
|
|
pub mod error;
|
|
pub mod table;
|
|
|
|
#[pymodule]
|
|
pub fn _lancedb(_py: Python, m: &PyModule) -> PyResult<()> {
|
|
let env = Env::new()
|
|
.filter_or("LANCEDB_LOG", "warn")
|
|
.write_style("LANCEDB_LOG_STYLE");
|
|
env_logger::init_from_env(env);
|
|
m.add_class::<Connection>()?;
|
|
m.add_function(wrap_pyfunction!(connect, m)?)?;
|
|
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
|
|
Ok(())
|
|
}
|