<commit_before>#[macro_export]
macro_rules! query_map {
($conn:ident, $query:expr, $params:expr, $T:ident, $($member:ident),* ) => {
		{		
			let stmt = $conn.prepare($query)
					.unwrap();
				
			let result = stmt.query($params).unwrap()
				.map(|row:postgres::Row| $T {
						$( $member: row.get(stringify!($member)) ),*
					});
			result.collect::<Vec<$T>>()			
		}
	}
}
<commit_msg>added support for custom mapping<commit_after>#[macro_export]
macro_rules! query_map {
	($conn:ident, $query:expr, $params:expr, $T:ident{ $($member:ident),* }) => {
		{		
			let stmt = $conn.prepare($query)
					.unwrap();
				
			let result = stmt.query($params).unwrap()
				.map(|row:postgres::Row| $T {
						$( $member: row.get(stringify!($member)) ),*
					});
			result.collect::<Vec<$T>>()			
		}
	};
	
	($conn:ident, $query:expr, $params:expr, $T:ident{ $($member:ident => $key:expr),* }) => {
		{
			let stmt = $conn.prepare($query)
					.unwrap();
				
			let result = stmt.query($params).unwrap()
				.map(|row:postgres::Row| $T {
						$( $member: row.get($key) ),*
					});
			result.collect::<Vec<$T>>()	
		}
	}
}

{'fraction_non_alphanumeric': 0.23660714285714285, 'fraction_numerical': 0.0, 'mean_word_length': 3.3618677042801557, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3888862', 'n_tokens_mistral': 520, 'n_tokens_neox': 434, 'n_words': 62}